-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvauvau.java
28 lines (26 loc) · 1.11 KB
/
vauvau.java
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
import java.io.*;
import java.util.*;
public class vauvau {
public static void main(String[] args) throws Exception {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
StringTokenizer st = new StringTokenizer(in.readLine());
int aggA = Integer.parseInt(st.nextToken());
int calmA = Integer.parseInt(st.nextToken());
int aggB = Integer.parseInt(st.nextToken());
int calmB = Integer.parseInt(st.nextToken());
int totalA = aggA + calmA;
int totalB = aggB + calmB;
st = new StringTokenizer(in.readLine());
for(int i = 0; i < 3; i++) {
int time = Integer.parseInt(st.nextToken());
int count = 0;
if(time % totalA <= aggA && time % totalA > 0) count++;
if(time % totalB <= aggB && time % totalB > 0) count++;
if(count == 0) out.println("none");
else if(count == 1) out.println("one");
else out.println("both");
}
out.close();
}
}