-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathI082.java
More file actions
27 lines (25 loc) · 855 Bytes
/
I082.java
File metadata and controls
27 lines (25 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package levelB;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class I082 {
public static void main(String[] args) throws Exception {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int N=Integer.parseInt(br.readLine());
int max=0,min=10000;
String maxID="",minID="";
for(int i=0;i<N;i++){
String[] str=br.readLine().split(" ");
int sum=Integer.parseInt(str[1])*Integer.parseInt(str[1])+Integer.parseInt(str[2])*Integer.parseInt(str[2]);
if(max<sum){
max=sum;
maxID=str[0];
}
if(min>sum){
min=sum;
minID=str[0];
}
}
br.close();
System.out.println(minID+" "+maxID);
}
}