Grand Temple Problem

I have done same problem from spoj but there my code is not getting submitted. PLease help me to find the mistake in the code.
The link of the code :-

The link of the problem :-

it looks like you have not read the question properly. there is a very small difference.
in this question, width and height are not given… leftmost point is start and rightmost point is end of the land… its even a simpler one.

updated code:https://ide.codingblocks.com/s/211897

please rate and resolve if satisfied.
thanks

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.

Sir my doubt was that I have done this question here but my code at spoj is not getting submitted due to wrong answer and I am not able to find my mistake

you have not handled n=0 case.

updated code:https://ide.codingblocks.com/s/213235
please rate and resolve if satisfied.
thanks

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.

Thanks sir for the help