a005.
Eva 的回家作業
--
POJ
| From: [122.116.139.112] |
發表日期
:
2014-01-04 21:39
import java.util.Scanner;
public class JAVA {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int t, a, b, c, d;
t = input.nextInt();
while (t-- != 0) {
a = input.nextInt();
b = input.nextInt();
c = input.nextInt();
d = input.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);
}
}
}
}