SRM 611. div2-1000. Submitted for 892 points.