document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. import java.util.Scanner;
  2. public class a005 {
  3. public static void main (String args[]) {
  4. Scanner cin = new Scanner(System.in);
  5. int t, a, b, c, d;
  6. t = cin.nextInt();
  7. while(t-- != 0) { //t-- 是好方法,不用for()來計算
  8. a = cin.nextInt(); //當變數少的時候,abcd比num[4]來得方便
  9. b = cin.nextInt();
  10. c = cin.nextInt();
  11. d = cin.nextInt();
  12. System.out.print(a + " " + b + " " + c + " " + d +" ");
  13. if(a-b == c-d)
  14. System.out.println(d+(d-c));
  15. else
  16. System.out.println(d*d/c);
  17. }
  18. }
  19. }
  20.  
');