Hi this is my first time trying to submit solution for the problem in codechef.
i had been through many issues (naming the file…) ,compilation, and now i’m stuck with
1>you are not printing Output in Given format according to question
2>you are using Scanner which is not time efficient you should choose to use BufferedReader for not getting Time limit exceeded.
3> you have Runtime error because you are not return 0 at end of program which is NZEC error
for your convenience you can see following solution
0 is returned to the environment as a status that program worked fine.
Scanner when used opens a streams reads the input then close the stream… closing and opening of stream takes time in case of large input however in buffered reader stream is oopened once all the input is buffered and then used :)… you can http://www.codechef.com/problems/INTEST test the difference in this problem… Used with scanner the program will take more time