题解 CF1325A 【EhAb AnD gCd】

· · 题解

根据两条性质:

\gcd(a,1)=1,\operatorname{lcm}(a,1)=a

所以输出 1 和 x-1 即可。

#include<bits/stdc++.h>
#define re register
using namespace std;
inline int read(){
    re int t=0;
    re char v=getchar();
    while(v<'0')v=getchar();
    while(v>='0'){
        t=(t<<3)+(t<<1)+v-48;
        v=getchar();
    }
    return t;
}
int n,m,t,a[100002];
int main(){
    t=read();
    while(t--){
        n=read();
        printf("%d %d\n",1,n-1);
    }
}