Submit | All submissions | Best solutions | Back to list |
Problem hidden
FELT - Finding ABC |
Vali and Munnazzar are playing a game based on number theory. Vali challenges Munnazzar to find three distinct integers a, a, and c such that for a given integer n:
a^n + b^n = c^n
If such integers exist, the program should print a, b, and c. Otherwise, it should output -1.
Input
The first line contains an integer t (1 ≤ t ≤ 100) — the number of test cases.
Each test case contains a single line containing an integer n (1 ≤ n ≤ 10,000).
Output
For each test case, print 3 distinct integers a, b, and c if they exist; otherwise, print -1.
It is to be noted that 0 < a, b, c.
If there exist multiple answers, print any.
Example
Input: 1 1 Output: 1 2 3
Added by: | Ammar |
Date: | 2025-04-12 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | C C++ 4.3.2 CPP CPP14 CPP14-CLANG JAVA PYTHON PYPY PYPY3 PYTHON3 |