Hoodies at coding blocks

what is wrong in this and which testcase fails

#include
#include
using namespace std;
int main() {
int n;
cin>>n;
queue<pair<int,int>>q;

char ch;
int cnt=0;
while(n--)
{
cin>>ch;
switch(ch){
	case 'E':

	    {int a,b;
		cin>>a>>b;
   q.push({a,b});
   }
   break;


    case 'D':
	  {cnt++;
  }
  break;
}
}
//cout<<cnt;
// while(!q.empty()){
// 	pair<int,int>p=q.front();
// 	cout<<p.first<<" "<<p.second<<endl;
// 	q.pop();
// }

    pair<int,int> ele=q.front();
	while(!q.empty() && cnt>0){
        
		cout<<ele.first<<" "<<ele.second<<endl;
		cnt--;
		q.pop();
		pair<int,int> y=q.front();
		while(ele.first!=y.first){
			// y=q.front();
			ele=q.front();
			q.pop();
			q.push(y);
			
		}
		ele=q.front();

	}


return 0;

}

hi @kumarakash121005
For the Given Problem, we are using 4 Queues each for the Four Prime Courses available at CB. each time an Rno came with a specified course number will join the other students in the Queue. We need to take another Queue to keep track of which course student came first as for rest of the students of the same course number will join that student.

refer this code -->

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.