Hostel Visit- both test cases are failing

I’m facing problem in the question HOSTEL VISIT, link to the question is below,
https://online.codingblocks.com/player/12341/content/5368?s=1499

My output seems to be correct yet I’m failing both the test cases.
link to my code is
https://ide.codingblocks.com/s/46564

Please guide me about where the flaw is?

Hey Surender, you are not considering one thing when count==k you are just popping out one element from pq and inserting a new h but first you should check if(distance(x,y) < pq.top()) if this true then only you should pop an element from pq and add the new one otherwise there is no need to add the new element.

thank you sir, both test cases have passed.
correct code is
https://ide.codingblocks.com/s/46588