Sichuan University Programming Contest 2012 Preliminary(team)

C: k steps