Reds varied directly as yellows and inversely as greens squared. If 400 reds and 40 yellows went with 10 greens, how many reds went with 20 yellows and 5 greens?