a prime conjecture

i am trying to solve this:
link text

and my solution is:
link text

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:
81
85
155
0
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!

ok…i got it…subtracting 1 from t3 and t2 was wrong…causing it to fail for typical test cases like 63. I made the correction…and the solution has been accepted

1 Like