记录 40分求助
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
int k,n,e,d;
scanf("%lld",&k);
for (int i=1;i<=k;i++){
scanf("%lld %lld %lld",&n,&e,&d);
int sum=n-e*d+2;
if (sum<=0){
printf("NO\n");
continue;
}
int tmp=sum*sum-4*n;
if (tmp<0){
printf("NO\n");
continue;
}
tmp=sqrt(tmp);
if (tmp>sum){
printf("NO\n");
continue;
}
printf("%lld %lld\n",(sum-tmp)/2LL,(sum+tmp)/2LL);
}
return 0;
}