codeforces 272c

Dima and Staircase