-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJ01007.java
More file actions
36 lines (30 loc) · 822 Bytes
/
J01007.java
File metadata and controls
36 lines (30 loc) · 822 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
36
import java.util.Scanner;
public class J01007 {
public static long[] f = new long[100];
public static void sieve() {
f[0] = 0;
f[1] = 1;
for (int i = 2; i <= 92; i++) {
f[i] = f[i - 1] + f[i - 2];
}
}
public static boolean check (long x) {
for (int i=0;i<=92;i++) {
if (f[i]== x) return true;
}
return false;
}
public static void main(String[] args) {
sieve();
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
while (n-- > 0) {
long x = sc.nextLong();
if (check(x)) {
System.out.println("YES");
} else {
System.out.println("NO");
}
}
}
}