Submission

Status:

[PPP-SSSSSSSSSS]

Subtask/Task Score:

{0/100}

Score: 0

User: qweqwe

Problemset: anna

Language: cpp

Time: 0.003 second

Submitted On: 2025-10-21 21:05:54

#include <bits/stdc++.h>
#define speed cin.tie(0)->sync_with_stdio(0)
#define ll long long
#define pii pair<int,int>
using namespace std;

int main(){
	speed;
	int n;cin >> n;
	for (int i=0;i<n;i++){
		vector<int> v(5);
		int mx=0;
		for (int j=0;j<5;j++){
			cin >> v[j];mx=max(mx,v[j]);
		}
		int a,b;a=mx;b=a-1;
		//cout << a << " " << b << "\n";
		bool yes=0;
		for (int j=1;j<=b;j++){
			for (int k=j+1;k<=a;k++){
				vector<int> temp;
				for (int l=0;l<5;l++){
					if ((v[l]==k+j || v[l]==k-j || v[l]==k*j || v[l]==k/j || v[l]==k%j)){
						temp.push_back(l);
					}
				}
				if (temp.size()>=5){
					cout << k << " " << j << "\n";yes=1;
				}
			}
			if (yes) break;
		}if (!yes) cout << 0 << " " << 0 << "\n";
	}
	return 0;
}