Friday, November 24, 2017

Cetvrta Kattis Problem Solution In Java


//Nayeem Shahriar Joy, Applied Physics & Electronic Engineering, University of Rajshahi.
import java.util.Scanner;
public class JavaApplication1 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner io=new Scanner(System.in);
String s1=io.nextLine();
String s2=io.nextLine();
String s3=io.nextLine();
String[]values1=s1.split(" ");
String[]values2=s2.split(" ");
String[]values3=s3.split(" ");
int A1,B1,A2,B2,A3,B3,A4=0,B4=0;
A1=Integer.parseInt(values1[0]);
B1=Integer.parseInt(values1[1]);
A2=Integer.parseInt(values2[0]);
B2=Integer.parseInt(values2[1]);
A3=Integer.parseInt(values3[0]);
B3=Integer.parseInt(values3[1]);
if(A1==A2)
{
if(B3==B2)
{
A4=A3;
B4=B1;
}
else
{
A4=A3;
B4=B2;
}
}
else if(A2==A3)
{
if(B1==B2)
{
A4=A1;
B4=B3;
}
else
{
A4=A1;
B4=B2;
}
}
else if(A1==A3)
{
if(B2==B3)
{
A4=A2;
B4=B1;
}
else
{
A4=A2;
B4=B3;
}
}
System.out.println(A4+" "+B4);
// TODO code application logic here
}
}

No comments:

Post a Comment