Please help - INTXOR(dec long)

problem link- https://www.codechef.com/DEC18B/problems/INTXOR

my solution-

#include <bits/stdc++.h>
#include  <iostream>
using namespace std;

int main()
{
   int t,n,i=5,j=6,k=7,u,v,l,m,d,q;

  cin>>t;
  while(t--)
  {
    cin>>n;
    int a[n]={0};
  
   cout<<"1 1 2 3"<<endl;fflush(stdout);
   cin>>u;
   l=u;
   cout<<"1 1 2 4"<<endl;fflush(stdout);
   cin>>v;
   m=v;
   d=l^m;
   
   cout<<"1 3 4 5"<<endl;fflush(stdout);
   cin>>u;
   a[4]=u^d;
   cout<<"1 3 4 6"<<endl;fflush(stdout);
   cin>>v;
   a[5]=v^d;
   
    while(k<=n)
    {
       cout<<"1 "<<i<<" "<<j<<" "<<k<<endl;fflush(stdout);
       cin>>u;
       a[k-1]=u^a[i-1]^a[j-1];
       k++;
       if(k<=n)
       {  cout<<"1 "<<i<<" "<<j<<" "<<k<<endl;fflush(stdout);
          cin>>v;
          a[k-1]=v^a[i-1]^a[j-1];
       }
       k++;
       i=i+2;j=j+2;
   }
     int oo,pp;
     cout<<"1 1 "<<n-1<<" "<<n<<endl;fflush(stdout);
     cin>>oo;
     a[0]=oo^a[n-2]^a[n-1];
     
       if(n%2==0){
          cout<<"1 2 "<<n-1<<" "<<n<<endl;fflush(stdout);
          cin>>pp;
          a[1]=pp^a[n-2]^a[n-1];
      }

     else{
        cout<<"1 2 "<<n-2<<" "<<n<<endl;fflush(stdout);
        cin>>pp;
       a[1]=pp^a[n-3]^a[n-1];  
     }

     q=a[0]^a[1];
     a[2]=l^q;
     a[3]=m^q;
   cout<<"2 ";
   for(int e=0;e<n;e++)
   cout<<a[e]<<" ";
   fflush(stdout);
   int c;
   cin>>c;
   
   if(c==-1)
    exit(0);
   
  }
 return 0;
}

getting WA

here i am just trying to get xor of 1,2,3 and then 1,2,4 and then compute d=3xor4 and after this i can compute anything(eg print 3 4 5 and then 5th element= d xor imput)

please please help

cout << “1 1 2 3” << endl; is an example case which won’t work on real test cases try something different.

but why ?? can you explain

here i am just trying to get xor of 1,2,3 and then 1,2,4 and then compute d=3xor4 and after this i can compute anything(eg print 3 4 5 and then 5th element= d xor imput)

i have proceeded exactly according to this approach…