Help me in solving PROGLANG problem WHATS WRONG IN MY CODE

My issue

My code

#include <iostream>
using namespace std;

int main() {
	int z;
	cin>>z;
	for(int i=0;i<z;i++){
	    
	    int arr[6];
	    for(int i=0;i<6;i++){
	        cin>>arr[i];
	    }
	    
	    if(arr[0]==1 || arr[0]==2){
	       if(arr[2]==1 && arr[3]==2){
	           cout<<"1\n";
	       }else if(arr[2]==2 && arr[3]==1){
	           cout<<"1\n";
	       }else if(arr[4]==1 && arr[5]==2){
	           cout<<"2\n";
	       }else if(arr[4]==2 && arr[5]==1){
	           cout<<"2\n";
	       }else{
	           cout<<"0\n";
	       }
	    }
	         
	       else if(arr[0]==3 || arr[0]==4){
	            if(arr[2]==3 && arr[3]==4){
	           cout<<"1\n";
	       }else if(arr[2]==4 && arr[3]==3){
	           cout<<"1\n";
	       }else if(arr[4]==3 && arr[5]==4){
	           cout<<"2\n";
	       }else if(arr[4]==4 && arr[5]==3){
	           cout<<"2\n";
	       }else{
	           cout<<"0\n";
	       }
	       }
	       
	        
	    
	        
	        
	        
	    
	    
	}
	return 0;
}

Problem Link: CodeChef: Practical coding for everyone

@shihrshsin
your conditions are not right
for test case
1 3 2 1 3 4
it will give 1 but the answer would be 0

thank you