You are viewing a single comment's thread. Return to all comments →
Solution in python :
t = int(input().strip()) for _ in range(t): N = int(input().strip()) max_product = -1 for a in range(1, N // 3): b = (N * (N - 2 * a)) // (2 * (N - a)) c = N - a - b if a < b < c and a * a + b * b == c * c: max_product = max(max_product, a * b * c) print(max_product)
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #9: Special Pythagorean triplet
You are viewing a single comment's thread. Return to all comments →
Solution in python :