Guy, please help me my program is showing correct output for example inputs and i have also tired some other inputs it is showing correct output.
I have put some comments also to help you understand the program better.
Please check it out
if ne==ns no of days will be 1 and not 8
2.if cnt(in ur prog ns)==1 u need to print smallest value of c greater than l and not c itself
the ac version of ur code- https://www.codechef.com/viewsolution/33562641
in line 29 of your code, else if(ne==ns)
{
c=8; //if starting day and ending day is same the gap is 8 days
}
for ne == ns, and c = ne - ns + 1,
c = 0 + 1 = 1 and not 8