求大佬调整
查看原帖
求大佬调整
1372344
ZJY1207楼主2024/10/22 20:40
#include<bits/stdc++.h>
using namespace std;
int main(){
	long long k;
	int a[100000];
	scanf("%lld",&k);
	while(k--){
		long long a,b,c;
		scanf("%lld%lld%lld",&a,&b,&c);
		long long x;
		x=a-b*c+2;
		bool qwe=true;
		long long p,q;
		for(int i=1;i<(x>>1);i++){
			p=i;
			q=x-i;
			if(p*q==a){
				cout<<p<<" "<<q<<"\n";
				qwe=false;
				break;
			}
		}
		if(qwe)printf("NO\n");
	}
}

样例过了,但是wa+tle

2024/10/22 20:40
加载中...