August LunchTime 2019 Eidi gift

Can anyone tell me what is wrong in my code?
Problem: Eidi Gift

#include
using namespace std;

int main() {

int t;
cin>>t;
int n=t;
if(t>=1 && t<=1000)
{

    int a1[n-1],a2[n-1],a3[n-1],c1[n-1],c2[n-1],c3[n-1];
    for(int i=0;i<t;i++)
    {
        cin>>a1[i]>>a2[i]>>a3[i]>>c1[i]>>c2[i]>>c3[i];
        if(17>=a1[i] && a1[i]>=1 && 17>=a2[i]&& a2[i]>=1 && 17>=a3[i] && a3[i]>=1 && 100>=c1[i] && c1[i]>=1 && 100>=c2[i] && c3[i]>=1 && 100>=c3[i] && c3[i]>=1)
        {

            if(a1[i]>a2[i] && a2[i]>a3[i] && c1[i]>c2[i] && c2[i]>c3[i] )
                cout<<"FAIR"<<endl;
            else if(a1[i]>a3[i] && a3[i]>a2[i] && c1[i]>c3[i] && c3[i]>c2[i])
                cout<<"FAIR"<<endl;
            else if(a2[i]>a1[i] && a1[i]>a3[i] && c2[i]>c1[i] && c1[i]>c3[i])
                cout<<"FAIR"<<endl;
            else if(a2[i]>a3[i] && a3[i]>a1[i] && c2[i]>c3[i] && c3[i]>c1[i])
                cout<<"FAIR"<<endl;
            else if(a3[i]>a1[i] && a1[i]>a2[i] && c3[i]>c1[i] && c1[i]>c2[i])
                cout<<"FAIR"<<endl;
            else if(a3[i]>a2[i] && a2[i]>a1[i] && c3[i]>c2[i]&& c2[i]>c1[i])
                cout<<"FAIR"<<endl;
            else if(a1[i]==a2[i] && a2[i]>a3[i] && c1[i]==c2[i] && c2[i]>c3[i])
                cout<<"FAIR"<<endl;
            else if(a1[i]==a2[i] && a1[i]<a2[i] && c1[i]==c2[i] && c1[i]<c2[i])
                cout<<"FAIR"<<endl;
            else if(a2[i]==a3[i] && a2[i]>a1[i] && c2[i]==c3[i] && c2[i]>c1[i])
                cout<<"FAIR"<<endl;
            else if(a2[i]==a3[i] && a2[i]<a1[i] && c2[i]==c3[i] && c2[i]<c1[i])
                cout<<"FAIR"<<endl;
            else if(a1[i]==a3[i] && a1[i]>a2[i] && c1[i]==c3[i] && c1[i]>c2[i])
                cout<<"FAIR"<<endl;
            else if(a1[i]==a3[i] && a1[i]<a2[i] && c1[i]==c3[i] && c1[i]<c2[i])
                cout<<"FAIR"<<endl;
            else if(a1[i]==a3[i] && a3[i]==a2[i] && c1[i]==c3[i] && c3[i]==c2[i])
                cout<<"FAIR"<<endl;

            else
                cout<<"NOT FAIR"<<endl;

        }


    }
}

return 0;

}

Please either format your code or link to your solution; the forum software has mangled this and it won’t compile :slight_smile:

Edit:

Wasn’t too badly mangled, after all - your code fails for the testcase:

1
9 9 17 61 61 93 

Thanks man,one small mistake ;-(.

1 Like