Sonya and Robots

CodeForces - 1004C