It is Chef's birthday. You know that Chef's favourite number is . You also know that Chef loves averages. Therefore you decide it's best to gift Chef integers , such that:
- The mean of and is .
- .
- and are distinct.
Output any suitable and which you could gift to Chef.
As a reminder, the mean of three numbers is defined as: .
For example, , .
Input Format
- The first line of input contains a single integer , denoting the number of test cases. The description of test cases follows.
- The first and only line of each test case contains one integer — Chef's favourite number.
Output Format
For each test case, one line containing space-separated integers — , and , which satisfy the given conditions. If there are multiple possible answers you may output any of them.
It can be shown that an answer always exists, under the given constraints.
Constraints
Sample Input 1
3
3
5
5
Sample Output 1
1 3 5
1 6 8
3 5 7
Explanation
Test Case :
Test Case :
Test Case :
solution:
#include <iostream>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--){
int a;
cin>>a;
cout<<a-1<<" "<<a<<" "<<a+1<<endl;
}
return 0;
}
No comments:
Post a Comment