huayucaiji
2020-03-16 09:34:33
首先,我们要来了解一些性质,以及 LCM 和 GCD 的一些特殊关联,我们从他们的定义入手:
首先,我们设:
其中,
由于我们知道:对于任意两个数
所以对于这道题,我们知道了
//#pragma GCC optimize("Ofast","-funroll-loops","-fdelete-null-pointer-checks")
//#pragma GCC target("ssse3","sse3","sse2","sse","avx2","avx")
#include<bits/stdc++.h>
using namespace std;
int read() {
char ch=getchar();
int f=1,x=0;
while(ch<'0'||ch>'9') {
f=-1;
ch=getchar();
}
while(ch>='0'&&ch<='9') {
x=x*10+ch-'0';
ch=getchar();
}
return f*x;
}
int n;
signed main() {
int t;
t=read();
while(t--) {
n=read();
cout<<1<<" "<<n-1<<endl;
}
return 0;
}