-
-
Notifications
You must be signed in to change notification settings - Fork 109
Expand file tree
/
Copy pathCatsandaMouse.java
More file actions
26 lines (22 loc) · 680 Bytes
/
Copy pathCatsandaMouse.java
File metadata and controls
26 lines (22 loc) · 680 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
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int q = in.nextInt();
for(int a0 = 0; a0 < q; a0++){
int x = in.nextInt();
int y = in.nextInt();
int z = in.nextInt();
print(x, y, z);
}
}
public static void print(int x, int y, int z) {
int distA = Math.abs(z-x);
int distB = Math.abs(z-y);
System.out.println((distA < distB) ? "Cat A" : ((distA > distB) ? "Cat B" : "Mouse C"));
}
}