要满足 GCD(a,b)+LCM(a,b)=x ,只要 a=1,b=x-1 即可。
AC代码:
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
#define ll long long
#define inf 0x3f3f3f3f
using namespace std;
const int N=1e3+10;
int t;
int x;
int main()
{
scanf("%d",&t);
while(t--)
{
scanf("%d",&x);
printf("1 %d\n",x-1);
}
return 0;
}