Failing the first test case

i created a max heap and kept its size strictly below k.
#include
#include
#include
#include
#include

using namespace std;

class Hostel
{
public:
int x,y;

int ans()
{
    return x*x +y*y;
}

};

int main(int argc, char const *argv[])
{
int q,k;
cin>>q>>k;

priority_queue <int> map;



while(q--)
{
    int why;
    cin>>why;

    if(why==1)
    {
      int x,y;
      cin>>x>>y;
      map.push(x*x+y*y);
      if(map.size()>k)
      {
          map.pop();
      }
        
    }
    else
    {
        cout<<map.top()<<endl;
    }
    
}


return 0;

}

You need to keep the visited hostels. Do not pop them forever.

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.