Pagini recente » Cod sursa (job #2022550) | Cod sursa (job #2816172) | Cod sursa (job #1721570) | Cod sursa (job #2426031) | Cod sursa (job #1788533)
#include <bits/stdc++.h>
#include <stdio.h>
#include <ctype.h>
#define y second
#define x first
#define lsb(x) (x&-x)
#define pb push_back
#define l(x) x<<1
#define r(x) (x<<1)|1
#define non(x) ( (x) > N? (x) - N : (x) + N)
#define y second
const int MOD=1000000007; //LOL
const int MAXM=210*210;
const int NMAX=4400;
const int HP=73;
const int SQRT=350;
using namespace std;
const double eps=1e-5;
const double PI=acos(-1.0);
typedef long long LL;
typedef long double LD;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<LD, LD> PLD;
typedef vector<int> VI;
const int m6[]={1, -1, 1, 1, -1, -1};
const int dx[]={0, 1, 0, -1};
const int dy[]={1, 0, -1, 0};
int n;
PII A[1066];
map<PII, int> M;
int main()
{
freopen("trapez.in", "r", stdin);
freopen("trapez.out", "w", stdout);
cout<<setprecision(10)<<fixed;
ios_base::sync_with_stdio(0);
cin>>n;
for(int i=1; i<=n; ++i)
{
cin>>A[i].x>>A[i].y;
}
for(int i=1; i<=n; ++i)
{
for(int j=i+1; j<=n; ++j)
M[{abs(A[i].x - A[j].x), abs(A[i].y - A[j].y)}]++;
}
int rs=0;
for(auto i: M)
{
rs+=(i.second*(i.second-1))/2;
}
cout<<rs<<"\n";
return 0;
}