CSU1615: Garden

Description

Zuosige always has bad luck. Recently, he is in hospital because of pneumonia. While he is taking his injection, he feels extremely bored. However, clever Zuosige comes up with a new game.

Zuosige wants to build a new garden because of his endless pursuit for beauty. There are three garden building teams A, B and C in his city. All he know is that if A and B work together, the garden will be completed in exactly x days and y days if B and C cooperate and z days if A and C do. Now he wants to know how many days is needed when these three teams work separately. Can you help him?

Input

The first line contains one integer T, indicating the number of test cases.
In one test case, there are only one line, which contains three integers x, y and z (1<=x, y, z<=300), as stated above.

Output

For each test case, output three integers indicating the answers. The first one is the number of days needed by A, then B, finally C. It is guaranteed that answers exists and are exactly integers.

Sample Input

2
1 1 1
2 2 3

Sample Output

2 2 2
6 3 6

HINT

Source


#include <iostream>
#include <stdio.h>
#include <string.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <math.h>
#include <bitset>
#include <algorithm>
using namespace std;
#define ls 2*i
#define rs 2*i+1
#define up(i,x,y) for(i=x;i<=y;i++)
#define down(i,x,y) for(i=x;i>=y;i--)
#define mem(a,x) memset(a,x,sizeof(a))
#define w(a) while(a)
#define LL long long
const double pi = acos(-1.0);
#define N 1000005
#define mod 19999997
#define INF 0x3f3f3f3f
#define exp 1e-8
int main()
{
    int T;
    int x,y,z;
    scanf("%d",&T);
    w(T--)
    {
        int a,b,c;
        scanf("%d%d%d",&x,&y,&z);
        a=2*x*y*z/(y*z+x*y-z*x);
        b=2*x*y*z/(x*z+y*z-x*y);
        c=2*x*y*z/(x*y+x*z-y*z);
        printf("%d %d %d\n",a,b,c);
    }
    return 0;
}



你可能感兴趣的:(CSU)