CodeForces 272C: Dima and Staircase Problem