SRM 197 Div 2 Level 1,2,3 [Dynamic Programming]