diff --git a/src/solve.c b/src/solve.c index 98c9917..1ec1f4f 100644 --- a/src/solve.c +++ b/src/solve.c @@ -106,11 +106,12 @@ static bool bfs(int128_t* sum, int128_t gcd, } if (output) { + int128_t a = a0 * gcd, b = b0 * gcd, c = c0 * gcd; fprintf(output, "\nSolution found!\n"); fprintf(output, "Initial: ("); - fprint_int128(output, a0); fprintf(output, ", "); - fprint_int128(output, b0); fprintf(output, ", "); - fprint_int128(output, c0); fprintf(output, ")\n"); + fprint_int128(output, a); fprintf(output, ", "); + fprint_int128(output, b); fprintf(output, ", "); + fprint_int128(output, c); fprintf(output, ")\n"); fprintf(output, "Final: ("); fprint_int128(output, found->a); fprintf(output, ", "); @@ -121,10 +122,11 @@ static bool bfs(int128_t* sum, int128_t gcd, } } else if (print_mode == 2) { if (output) { + int128_t a = a0 * gcd, b = b0 * gcd, c = c0 * gcd; fprintf(output, "For ("); - fprint_int128(output, a0); fprintf(output, ", "); - fprint_int128(output, b0); fprintf(output, ", "); - fprint_int128(output, c0); + fprint_int128(output, a); fprintf(output, ", "); + fprint_int128(output, b); fprintf(output, ", "); + fprint_int128(output, c); fprintf(output, ") the required amount of moves is: %i\n", max_moves); } } else if (print_mode == 3) {