Submission
Status:
[PPP-SSSSSSSSSS]
Subtask/Task Score:
{0/100}
Score: 0
User: yypp
Problemset: anna
Language: cpp
Time: 0.002 second
Submitted On: 2026-03-25 15:48:34
#include <bits/stdc++.h>
using namespace std;
int main() {
int n; bool fnd=false;
long long a[5],t1,x,y;
cin >> n;
for (int i=0;i<n;i++) {
fnd=false;
unordered_map<long long,long long> mp;
for (int j=0;j<5;j++) {
cin >> t1;
a[j] = t1;
mp[t1] = j;
}
for (int j=0;j<5;j++) {
if (fnd == true) break;
for (int k=0;k<5;k++) {
//printf("%d %d\n",j,k);
if (j!=k) {
if ((a[j]+a[k])%2==0) {
x = (a[j]+a[k])/2; //a
y = max(a[j],a[k])-x; //b
if (y==0) continue;
//printf(" = %d %d\n",x,y);
//printf("ck %d %d %d \n",mp[x*y],mp[x/y],mp[x%y]);
if (mp[x*y]!=0&&mp[x/y]!=0&&mp[x%y]!=0) {
cout << x << " " << y << "\n"; fnd=true; break;
}
}
}
}
}
if (fnd==false) cout << "0 0\n";
}
}