TopCoder SRM 638 div 2, 250 and 500. AC. *Blue* :)