改对必关,只不过我这个蒟蒻还是求个悬关
#include<bits/stdc++.h>
using namespace std;
int main()
{
int q;
cin>>q;
while(q--)
{
int n,e,d;
cin>>n>>d>>e;
bool flag = false;
for(int i = 1;i<=n;i++)
{
for(int j = 1;j<=n;j++)
{
if(i * j == n && e * d == (i-1) * (j-1) - 1)
{
cout<<i<<" "<<j<<endl;
flag = true;
}
}
}
if(flag == false)
{
cout<<"NO"<<endl;
}
}
return 0;
}