欢迎访问https://blog.csdn.net/lxt_Lucia~~
宇宙第一小仙女\(^o^)/~萌量爆表求带飞=≡Σ((( つ^o^)つ~ dalao们点个关注呗~
--------------------------------我只是一条可爱哒分界线-------------------------------
一、问题:
Description
Anton has a positive integer n, however, it quite looks like a mess, so he wants to make it beautiful after k swaps of digits.
Let the decimal representation of n as (x1x2⋯xm) satisfying that 1 ≤ x1 ≤ 9, 0 ≤ xi ≤ 9 ( 2 ≤ i ≤ m),which means n = ∑ (i = 1 ~ i = m) xi * 10的 m−i 次方. In each swap, Anton can select two digits xi and xj (1 ≤ i ≤ j ≤ m ) and then swap them if the integer after this swap has no leading zero.
Could you please tell him the minimum integer and the maximum integer he can obtain after k swaps?
Input
The first line contains one integer T, indicating the number of test cases.
E