Hostel visit is passing only one test case pls dont change the entire code

https://ide.codingblocks.com/s/390019 is passing only one
test case

Hello @shrutikatyal please wait i am checking your code:

Hello @shrutikatyal if you will use long long int as the data tyoe then you will see that your code is passing test cases for all the cases except 1 and in that it is giving TLE.
that TLE.

hello @shrutikatyal this is the correct code:


if you have any doubt you can ask here:
Happy Learning !!