solutions for problems 1384, 1510