How many Fibonacci numbers
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Fibonacci sequence is a sequence where each element equals to the sum of two previous ones, except for the first two elements: F[1]
= 1, F[2]
= 1, F[n]
= F[n-2]
+ F[n-1]
.
1 1 2 3 5 8 13 21 ...
Given array of integers. How many Fibonacci numbers are there?
Input
The first line contains the amount k of input numbers. The next line contains k integers a[1]
, a[2]
, ..., a[k]
(0 < k ≤ 1000, 0 ≤ a[i]
< 2^63
).
Output
Print a single number - how many Fibonacci numbers in the given array of integers.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 37%