N Triplets Codechef solutions Today | Codechef Starters 72 ✅ (100/100) FULL | AC Code ✅| NTRIPLETS
Problem
Alice is still not satisfied with Bob's math skills so she gave him a new challenge.
Given a positive integer , find any distinct positive integers such that:
- The product of any two of these integers is a divisor of .
- The product of all three integers is a multiple of .
If multiple solutions exist, you may print any of them.
Print if no solution exists.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
- The first and only line of each test case contains a single integer, .
Output Format
For each test case, output on a new line three space-separated integers satisfying the given condition.
Print if the answer does not exist.
Constraints
Sample 1:
Input
Output
3 30 24 3
2 3 5 2 6 4 -1
Explanation:
Test case : We have . They satisfy all the conditions:
- are all divisors of
- is a multiple of
Test case : We have . They satisfy all the conditions:
- are all divisors of
- is a multiple of
Test case : It can be shown that no three positive integers satisfy the conditions.