TopCoder SRM 622 div 2, 500 AC.