forked from jessifebria/Kattis-Solution
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNumber Fun
29 lines (27 loc) · 766 Bytes
/
Number Fun
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
import java.util.Scanner;
public class Kattistry {
public static void main(String[] args) {
Scanner scan= new Scanner (System.in);
int a=scan.nextInt();
for (int i = 0; i < a; i++) {
float b=scan.nextFloat();
float c=scan.nextFloat();
float d=scan.nextFloat();
if (Math.abs(b-c)==d) {
System.out.println("Possible");
}
else if ((b+c)==d) {
System.out.println("Possible");
}
else if (Math.abs(b*c)==d) {
System.out.println("Possible");
}
else if(((b/c)==d) ||(c/b)==d) {
System.out.println("Possible");
}
else {
System.out.println("Impossible");
}
}
}
}