题目链接-A. EhAb AnD gCd
题目大意
输入一个正整数x,找出这样的2个正整数a和b,使得gcd(a,b)+lcm(a,b)=x
解题思路
找最特殊的情况a=1,b=x-1即可
这样a,b两个数最大公因数为1,最小公倍数x-1,满足题意√
附上代码
#include
#define int long long
#define lowbit(x) (x &(-x))
using namespace std;
const int INF=0x3f3f3f3f;
const double PI=acos(-1.0);
const double eps=1e-10;
const int M=1e9+7;
const int N=1e5+5;
typedef long long ll;
typedef pair PII;
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
int t;
cin>>t;
while(t--){
int n;
cin>>n;
cout<<1<<" "<<n-1<<endl;
}
return 0;
}