vafin20

1

Apr 12th, 2021
563
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.io.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStreamReader;
  4.  
  5.  
  6. public class Main {
  7.     public static void main(String[] args) throws IOException {
  8.         BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
  9.         String [] domino1 = reader.readLine().split(" ");
  10.         String [] domino2 = reader.readLine().split(" ");
  11.         int a = Integer.parseInt(domino1[0]);
  12.         int b = Integer.parseInt(domino1[1]);
  13.         int x = Integer.parseInt(domino2[0]);
  14.         int y = Integer.parseInt(domino2[1]);
  15.  
  16.         if (a == x) {
  17.             System.out.println(b + " " + a + " " + x + " "  + y);
  18.         }
  19.         else if (a == y) {
  20.             System.out.println(b + " " + a + " " + y + " "  + x);
  21.         }
  22.         else if (b == x) {
  23.             System.out.println(a + " " + b + " " + x + " "  + y);
  24.         }
  25.         else if (b == y) {
  26.             System.out.println(a + " " + b + " " + y + " "  + x);
  27.         }
  28.         else {
  29.             System.out.println(-1);
  30.         }
  31.     }
  32. }
  33.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×