Why wrong answer

#include
#include
#include
using namespace std;
int main() {
priority_queuepq;
int q,k;
cin>>q>>k;
int count=1;
while(q–){
int a;
cin>>a;
if(a==1){

		int p,q;
		cin>>p>>q;
		if(count>3){
		if(p*p+q*q >pq.top()){
			count++;
			continue;
		}
		else{
			pq.pop();
		pq.push(p*p + q*q);
		}
		
    	}
		else{
			pq.push(p*p + q*q);
		}
		count++;
	}
	else{
		cout<<pq.top()<<endl;
	}
}
return 0;

}

hi @kumawatnitesh093 refer

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.