题解 | #游游的最小公倍数#
游游的最小公倍数
https://www.nowcoder.com/practice/385c7aa397e54bb58f36286ab0d65156
import math
def A(n):
a=n//2
b=n-a
while math.gcd(a,b)!=1:
a-=1
b+=1
return a,b
for _ in range(int(input())):
n=int(input())
print(*A(n))
a,b互质且差值最小时符合条件,就从n的一半开始一步一步算。