Consider Bob first
Every year that his first 100isinvestedhegetsaflat10 interest
Every year that the second deposit of 200isinvestedhegetsaflat20 interest (plus the 10thatheisgettingforhefirst100
So this is how much he will have at then end of each year up to 10years
110,120, 130,140, 150350, 380,410, 440,470, 500Soafter10yearsBobhas500
Now think about Judy
n must be equal to 1,2,3,4, or 5 because otherwise 2n is more than 10 which is no good.
If n=1 then the first 100 dollars is invested for (10-1) years It will will accumulate to 100*1.08^9
the 200 is invested for (10-2) years. It will will accumulate to 200*1.08^8
Together these add up to 570.Bobonlygets500 so this is too much.
Try n=2 and see if it works.
When you get the correct n, the amount might not be exactly $500 bit it will be close.