I have changed the input format Please check if any correction needs to be done

hello @nitinchoudhary260

check now->

for first element handle it ouside the loop.

Thanks for resolving the issue

Still test case 2 and Test case 3 are not running

thats becuase cin and cout are slow.

add these two lines just in the start of int main.

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

read about fast io in c++ for details of these two lines

Thanks for the fast I/O

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.