added program to solve problem 1