Hotel visit (HEAP)

i am maintaining k sized heap

MY PROBLEM:
in my code if in line 10 i do v[ l ] >=v[ min ] instead of v[ l ] > v[ min ] then i pass only the second test case but when i don’t do this then i pass only the first test case

i am not able to understand why is it so and why it makes a difference when i have done these changes

PLEASE HELP ME
my code:
https://ide.codingblocks.com/s/56143

qn link:
https://hack.codingblocks.com/contests/c/511/1629

use directly priority_queue STL for heaps.
Approach:
After inserting K elements
for any new element check
1.if its distance is greater than heaps top elements then do nothing
2.else remove top element from heap and insert new elements distance into heap