why this code gives wrong answer in first test case.
link : https://ide.codingblocks.com/s/149138
Related to problem : Hostel visit
Your code is working fine. I have compared your output with desired output.Its identical. There is some problem from our end. It will be rectified.