Fibonacci Subsequence
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
A sequence of integer numbers a_1, a_2, ..., a_n is called a Fibonacci sequence if a_i = a_{i-2} + a_{i-1} for all i = 3, 4, ..., n.
Given a sequence of integer numbers c_1, c_2, ..., c_m you have to find its longest Fibonacci subsequence.
Input
The first line of the input file contains m (1 ≤ m ≤ 3000). Next line contains m integer numbers not exceeding 10^9 by their absolute value.
Output
On the first line of the output file print the maximal length of the Fibonacci subsequence of the given sequence. On the second line print the subsequence itself.
Examples
Input #1
Answer #1
Submissions 104
Acceptance rate 43%