Here is my code link:
Please help.
Why my code is failing for the sample test case while I see correct output in other ides?
Hey @thirumeni.m07
Remove them
// #ifndef ONLINE_JUDGE
// freopen(“input.txt”, “r”, stdin);
// freopen(“output.txt”, “w”, stdout);
// #endif
And ur code will work fine 
If this resolves ur query then please mark it as resolved 