i am trying to solve this:
and my solution is:
When i submit it, it shows wrong answer, though it works fine on my computer. I tested it locally using an input and an output text file.
The contents of the input file are:
The contents of the output file:
29 5 3
73 2 2
79 7 3
The output written to the out.txt file is exactly as the problem demands. What am I doing wrong? Thanks in advance!