EPS/2024/04/08-04-24/a.py

16 lines
320 B
Python
Raw Permalink Normal View History

2024-04-15 13:45:30 +02:00
def main():
n, d = map(int, input().split())
a = [int(i) for i in input()]
for c in range(len(a)):
i = a[c]
if i < d:
a.insert(c, d)
return "".join([str(b) for b in a])
return "".join([str(b) for b in a])+str(d)
for _ in range(int(input())):
print(main())