为什么会过
查看原帖
为什么会过
467357
firstlight楼主2022/11/5 19:15
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<cmath>
using namespace std;
typedef long long LL;
LL n,e,d;
LL m,k;
LL q,p;
int main()
{
    scanf("%d",&k);
    for(int i=1;i<=k;i++)
    {
        scanf("%lld%lld%lld",&n,&e,&d);
        m=n-e*d+2;
        LL x=sqrt(m*m-4*n);
        if(x*x!=m*m-4*n) puts("NO");
        else printf("%d %d\n",(m-x)/2,(m+x)/2);
    }
    return 0;
}
2022/11/5 19:15
加载中...