-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathABC348B.cpp
More file actions
24 lines (24 loc) · 765 Bytes
/
ABC348B.cpp
File metadata and controls
24 lines (24 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <bits/extc++.h>
using namespace std;
namespace pbds = __gnu_pbds;
using ui = unsigned int;
using uli = unsigned long long int;
using li = long long int;
int main(void) {
ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
size_t n;
cin >> n;
vector<pair<int, int>> a(n);
for (pair<int, int>& i : a) cin >> i.first >> i.second;
for (pair<int, int> const& i : a) {
size_t p = 0;
for (size_t j = 1; j < n; ++j)
if ((i.first - a[p].first) * (i.first - a[p].first) +
(i.second - a[p].second) * (i.second - a[p].second) <
(i.first - a[j].first) * (i.first - a[j].first) +
(i.second - a[j].second) * (i.second - a[j].second))
p = j;
cout << p + 1 << '\n';
}
return 0;
}