Yet Another Constructive Problem solution codechef
You are given a positive integerwhich is at most .
Find three distinct non-negative integersthat do not exceed and satisfy the following equation:
It can be shown that a solution always exists for inputs satisfying the given constraints. If there are multiple solutions, you may print any of them.
Input Format Yet Another Constructive Problem solution codechef
- The first line contains an integer , the number of test cases. The description of test cases follows.
- Each test case consists of a single line containing one integer, .
- For each test case, print on a new line three different space-separated integers .
- Your output will be considered correct only if are distinct non-negative integers not exceeding that satisfy the equation given in the problem statement.
- If there are multiple solutions, you may print any of them.
Constraints Yet Another Constructive Problem solution codechef
- must be pairwise distinct
Sample Input 1
4 3 2 13 100000000
Yet Another Constructive Problem solution codechef Sample Output 1
1 2 3 2 3 4 6 9 13 23570468 129811858 80835401
Test case: and hence is one valid solution when . However there are several other solutions.
For example,is also valid and will also be considered correct.
Test case: .
Test case: .