Sichuan University Programming Contest 2014 Preliminary(team)

A: k-th number pair