Pagini recente » Cod sursa (job #1982823) | Cod sursa (job #2318764) | Cod sursa (job #265031) | Cod sursa (job #1953124) | Cod sursa (job #2751158)
//
// main.cpp
// patrate3
//
// Created by Vlad Calomfirescu on 14.05.2021.
//
#include <fstream>
#include <set>
#include <algorithm>
#include <cmath>
using namespace std;
ifstream fin ("patrate3.in");
ofstream fout ("patrate3.out");
set < pair < int, int >>p;
int
verif (pair < int, int >a, pair < int, int >b)
{
int x, y;
if (a == b)
{
return 0;
}
y = b.first - a.first;
x = a.second - b.second;
return (p.find (
{
a.first + x, a.second + y}
) != p.end () && p.find (
{
b.first + x, b.second + y}
) != p.end ());
}
int
citeste ()
{
double val;
fin >> val;
return round (val * 10000);
};
int
main ()
{
int n, i, rez = 0;
fin >> n;
for (i = n; i >= 0; i--)
{
p.insert (
{
citeste (), citeste ()}
);
}
for (auto i:p)
{
for (auto j:p)
{
rez += verif (i, j);
}
}
fout << rez / 4 << '\n';
return 0;}