According to the short cut formula
n lambda = d sin theta
just set up x sine angle to 420 sine angle ratio.
However, this only works for small angles.
If that does not give right answer, you have to distance ratios
more complications
Heat conduction from the surface it is sitting upon.
Radiation heating if it is in a lit area.
Simple experiment, do the whole thing in a calorimeter.
two step problem
Get y for the green first,using the 500
then add the y + 0.1 meter to get the spread for the other color
Although from the question, I could not tell if you use y +.1 or y-.1
Then solve for wavelength of other color
Maybe one of them gives a bad answer.