SRM 450. div2-500. Submitted for 487 points