Help me in solving HIGHSCORE problem

My issue

help me debug. Failing for this case.
1
3
0 0 1 2

My code

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

int main() {
	// your code goes here
	
	int t;
	cin>>t;
	cin.ignore();  // Ignore the newline character
	while(t--)
	{
    int n,a,b,c,d;
    cin>>n;
    cin>>a>>b>>c>>d;
    int x =a;
    
    if(b>x){
        x=b;
    }
    if(c>x)
    {
        x=c;
    }
    if(d>x){
        x=d;
    }
    
    
    cout<< x<<endl;
	}
	
	

}

Problem Link: Score High Practice Coding Problem - CodeChef

@savitrik
just remove cin ignore.

I had tried without cin before. But it worked this time. Thank you!