my code is giving correct output for sample input but wrong for test cases
#include
#include
#include
using namespace std;
int main() {
int q;
int k;
cin>>q>>k;
int query;
priority_queue<int> topk;
for(int i=0;i<k;i++)
{ topk.push(10000000);}
for(int i=0;i<q;i++)
{
cin>>query;
if(query==1)
{
int x,y;
cin>>x>>y;
int dist= ((x*x)+(y*y));
if(dist<topk.top())
{
topk.pop();
topk.push(dist);
}
}
else if(query==2)
{
cout<<topk.top()<<endl;
}
}
return 0;
}