-
Notifications
You must be signed in to change notification settings - Fork 0
/
Multiplication.java
42 lines (34 loc) · 1.13 KB
/
Multiplication.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Multiplication {
public static void main(String[] args) throws IOException {
// read in std input with buffered reader
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = null;
try {
line = br.readLine();
String[] numbers = line.split(" ");
double a = Long.parseLong(numbers[0]);
double b = Long.parseLong(numbers[1]);
double expected = Long.parseLong(numbers[2]);
if ((a == 0 || b == 0) && expected == 0) {
System.out.println("Yes");
return;
}
if (a == 0 || b == 0) {
System.out.println("No");
return;
}
if ((a / expected) * b >= 1) {
System.out.println("Yes");
} else {
System.out.println("No");
}
} catch (Exception e) {
System.out.println("No");
} finally {
br.close();
}
}
}