CodeForces round 6 div 2, A solved.