2012 summer practice contest 5

B: K-th Number