problem 39

yay loop bounds