-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLaLiga.java
More file actions
35 lines (30 loc) · 994 Bytes
/
LaLiga.java
File metadata and controls
35 lines (30 loc) · 994 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
28
29
30
31
32
33
34
35
package problems.codechef;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
/**
* Created by arpit on 21/5/17.
*/
public class LaLiga {
public static void main(String[] args) throws IOException {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine());
String[] s;
HashMap<String, Integer> map = new HashMap<>();
while (t-- > 0) {
for (int i = 0; i < 4; i++) {
s = br.readLine().split("\\s");
map.put(s[0], Integer.parseInt(s[1]));
}
System.out.println(solve(map));
}
}
private static String solve(HashMap<String, Integer> map) {
if (map.get("Barcelona")>map.get("Eibar") && map.get("RealMadrid")< map.get("Malaga"))
return "Barcelona";
else
return "RealMadrid";
}
}