#include<iostream>
using namespace std;
int main(){
int k, n, d, e, p, q;
cin>>k;
while(k--){
cin>>n>>d>>e;
int ans=n+2-d*e;
int b=1;
for(p=1;p<=ans/2;p++){
q=ans-p;
if(p*q==n&&(p-1)*(q-1)+1==d*e){
cout<<p<<' '<<q<<endl;
b=0;
break;
}
}
if(b){
cout<<"NO"<<endl;
}
}
return 0;
}
提交记录
由于我太蒻了题解只看懂了三分之一,到后面脑子直接爆炸