#Z01476. 最长等差序列

最长等差序列

题目描述

给定一个序列,长度为n,求出最长等差序列的长度。

输入格式

第一行一个整数n,(3<=n<=1000),第二行n个数

输出格式

最长等差序列长度

3
1 2 3
4
1 1 1 1
3
4