SRM 606. div2-1000. Submitted for 613 points