Added SRM 500 Div 2 problem 2. My first 500 point successful submission ;)