为什么连输出都没有,求助!!!
查看原帖
为什么连输出都没有,求助!!!
1069816
Tsuki091117楼主2023/8/21 16:08
#include<bits/stdc++.h>
using namespace std;
int k,p,q,n,e,d;
int main(){
	ios::sync_with_stdio(false);
	cin>>k;
	while(k--){
		cin>>n>>d>>e;
		bool l=false;
		int x=n-e*d;
		for(int i=1;i<=x/2;i++){
			for(int j=x/2+1;j<=x;j++){
				if(i+j==x&&i*j==n){
					l=true;
					cout<<i<<" "<<j<<endl;
					break;
				}
			}
			if(l==1){
				break;
			}
		}
		if(l==0){
			cout<<"NO"<<endl;
		}
	}
	return 0;
}
2023/8/21 16:08
加载中...