SRM 450. div2-250. Submitted for 244 points