# March long challenge problem missing number

#include <bits/stdc++.h>
using namespace std;
#define int long long

void swap(int *a,int *b)
{
int temp = *a;
*a = b;
b = temp;
}
/double disc(int a, int b){
int d=(a
a)-(4
b);
double re=sqrt(d);
//cout<<“d is =”<<re<<endl;
return re;
}
/
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin>>t;
while(t–){
int a,b,c,d;
cin>>a>>b>>c>>d;
int num1=a;
int num2=b;
int num3=c;
int num4=d;
if(num1>num2) swap(&num1,&num2);
if(num3>num4) swap(&num3,&num4);
if(num1>num3) swap(&num1,&num3);
if(num2>num4) swap(&num2,&num4);
if(num2>num3) swap(&num2,&num3);
int flag=0;
// cout<<num1<<" “<<num2<<” “<<num3<<” “<<num4<<endl;
if(num2==num3 && num2-1==num1 && num2+1==num4 && num2<=10000){
cout<<num2<<” “<<“1”<<endl;
flag=1;
}
else if(num1<0 && num2==0 ){
if((num4-1)==num3 && num3<=10000 && num1==1-num3){
//if(num1==1-num3){
cout<<“1”<<” "<<num3<<endl;
flag=1;
//}

}
else{
int p=num1+num3;
if(p%2==0){
p=p/2;

int q=num3-p;
//cout<<p<<" "<<q<<endl;
if(p>10000 || q>10000 || p<=0 || q<=0 || p>q){
flag=0;
}
else{
if((p/q)==num2 && p*q==num4){
cout<<p<<" "<<q<<endl;
flag=1;
}
}
}
}

}
else if(num1==0 && num2==1 ){
if(num3==1){cout<<“1 1”<<endl; flag=1;}
else if((num3/2)*(num3/2)==num4 && num3%2==0 && num3/2<=10000){cout<<num3/2<<" "<<num3/2<<endl; flag=1;}

}

else{
int p=num2+num3;
if(p%2==0){
p=p/2;

int q=num3-p;
//cout<<p<<" "<<q<<endl;
if(p>10000 || q>10000 || p<=0 || q<=0 || p<q){
flag=0;
}
else{
if((p/q)==num2 && p*q==num4){
cout<<p<<" "<<q<<endl;
flag=1;
}
}
}

}

if(flag==0 || flag==4){
cout<<"-1"<<" “<<”-1"<<endl;
}
}
return 0;
}
Please, help me to find out where this will go wrong