Having Problem in submission

I run the code for more than 20 times, its showing the same output as given in the problem but in the submission page its showing “Wrong Answer”…

@samsruti there might be some test case for which your code is not giving correct output just think over it … the test case on the problem page are not the only test case there must be another test case try to generate you own test case and output a/c to you and than test on ur code

your code should run for all the possible test cases, not for few.

@saajan and @nanda19, i run the program with different test cases . Still i am having the Wrong Answer.

There must be some corner cases that you are missing or rethink your logic…I m sure u will discover the bug in yr code…

@samsruti make your code such that it is general means that it should run for all set of cases not for a specified given in the question think and surely you will get the correct solution

i am getting the same problem,is there any need to get input from any file or generate output on any text file?