Pagini recente » Cod sursa (job #1884203) | Cod sursa (job #1981326) | Cod sursa (job #1135666) | Cod sursa (job #629751) | Cod sursa (job #1907024)
#include<bits/stdc++.h>
#define x first
#define pb push_back
#define mp make_pair
#define y second
#define all(a) a.begin(), a.end()
#define l(x) (x<<1)
#define r(x) ((x<<1) | 1)
#define f(x) x>>1
#define lsb(x) (x&(-x))
using namespace std;
typedef long long LL;
typedef long double LD;
typedef vector<LL> VLL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef vector<int> VI;
typedef VI::iterator vit;
typedef tuple<int,int,int> PIII;
const LL INF=(1LL<<62);
const int MAXN=505;
const int LOGMAX=18;
const int MOD=70657;
const LD pi=acos(-1.0);
const int dx[] = {0, 1, 1, 0, -1, -1};
const int dy[] = {1, 0, -1, -1, 0, 1};
map<PII, int> M;
PII A[1005];
void solve(){
int n;
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)}]++;
}
LL rs=0;
for(auto el: M){
rs+=1LL*(el.y)*(el.y-1)/2;
}
cout<<rs<<"\n";
}
int main()
{
cout<<setprecision(6)<<fixed;
ios_base::sync_with_stdio(0);
cin.tie(0);
freopen("trapez.in", "rt", stdin);
freopen("trapez.out", "wt", stdout);
solve();
return 0;
}