SRM 275 Round1, Division 1, Level 1
first attempt
attempt two using recursion
problem solved, added comments