Comments

Can you tell me where I am wrong? I don't know where I am wrong, for which test case my code is not working

Can you tell me where I am wrong? I don't know where I am wrong, for which test case my code is not working.

but bro the example you take 2 2 3 3,

x1 = 2 and y1 = 3

x2 = 2 an d y2 = 3

the output for above example is 0 and my code gives the 0 as output

can anyone help me, for which test case my code didn't work

//this code

#include<bits/stdc++.h>

using namespace std;

int main(){
    int t;
    cin>>t;
    while (t--)
    {
        int a1,a2,b1,b2;
        cin>>a1>>a2>>b1>>b2;
        int x1 = min(a1,a2), x2 = max(a1,a2);
        int y1 = min(b1,b2), y2 = max(b1,b2);

        if(x1==x2 && y1==y2 && x1==y1){
            cout<<0<<endl;
        }

        else if(x1>=y2){
            cout<<4<<endl;
        }

        else if(x2<=y1){
            cout<<0<<endl;
        }

        else{
            cout<<2<<endl;
        }
    }
    
    return 0;
}