# cf 20190307 Codeforces Round #543 (Div. 2, based on Technocup 2019 Final Round)

B. Mike and Children
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Mike decided to teach programming to children in an elementary school. He knows that it is not an easy task to interest children in that age to code. That is why he decided to give each child two sweets.

Mike has

Since Mike has taught for many years, he knows that if he gives two sweets with sizes

Mike wants to invite children giving each of them two sweets. Obviously, he can‘t give one sweet to two or more children. His goal is to invite as many children as he can.

Since Mike is busy preparing to his first lecture in the elementary school, he is asking you to find the maximum number of children he can invite giving each of them two sweets in such way that nobody will be upset.

Input

The first line contains one integer

The second line contains

Output

Print one integer — the maximum number of children Mike can invite giving each of them two sweets in such way that nobody will be upset.

Examples
Input
Copy
8
1 8 3 11 4 9 2 7

Output
Copy
3

Input
Copy
7
3 1 7 11 9 2 12

Output
Copy
2

Note

In the first example, Mike can give

In the second example, Mike can give

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
const int maxn = 1300;
const int inf=2e5+10;
int p[inf];
bool cmp(int a,int b)
{
return a>b;
}
int main()
{
int n,a[maxn];
ll ans=0;
memset(p, 0, sizeof(p));
cin >> n;
for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
for (int i = 1; i <= n; i++)
{
for (int j = i+1; j <= n; j++)
{
p[a[i] + a[j]]++;
ans=max(1ll*p[a[i]+a[j]],ans);
}

}
printf("%d\n",ans);
return 0;
}


cf 20190307 Codeforces Round #543 (Div. 2, based on Technocup 2019 Final Round)

(0)
(0) 