2011-06-17 12:44:03Morris

[JAVA] a005. Eva 的回家作業

/**********************************************************************************/
/*  Problem: a005 "Eva 的回家作業" from POJ                                  */
/*  Language: JAVA                                                                */
/*  Result: AC (136ms, 5652KB) on ZeroJudge                                       */
/*  Author: new1028 at 2011-06-17 08:57:20                                        */
/**********************************************************************************/


import java.util.Scanner;
public class a005 {
    public static void main (String args[]) {
        Scanner cin = new Scanner(System.in);
        int t, a, b, c, d;
        t = cin.nextInt();
        while(t-- != 0) {
            a = cin.nextInt();
            b = cin.nextInt();
            c = cin.nextInt();
            d = cin.nextInt();
            System.out.print(a + " " + b + " " + c + " " + d +" ");
            if(a + c == 2*b && b + d == 2*c)
                System.out.println(2*d-c);
            else
                System.out.println(d*d/c);
        }
    }
}