CodeForces round 272 div 2, A and B. AC.