题解 | 小数字
小数字
https://www.nowcoder.com/practice/faaaa4ddadb34bae88b37fcb635654f1
import math
T=int(input())
for i in range(T):
n,m=map(int,input().split())
a=0
while n>=3 and a<m:
n=math.ceil(n**0.5)
a+=1
if a<m:
print(n-m+a)
else:
print(n)