Problem - 1651D - Codeforces
Problem - 1651D - Codeforces
|
stdfloat | Logout
HOME TOP CATALOG CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP
You are given n distinct points on a plane. The coordinates of the i -th point are (x i , yi ).
→ Virtual participation
For each point i , find the nearest (in terms of Manhattan distance) point with integer
coordinates that is not among the given n points. If there are multiple such points — you can
choose any of them. → Clone Contest to Mashup
Examples
input Copy
6
2 2
1 2
2 1
3 2
2 3
5 5
output Copy
1 1
1 1
2 0
3 1
2 4
5 4
input Copy
8
4 4
2 4
2 2
2 3
https://codeforces.com/problemset/problem/1651/D 1/2
2/20/24, 9:35 PM Problem - 1651D - Codeforces
1 4
4 2
1 3
3 3
output Copy
4 3
2 5
2 1
2 5
1 5
4 1
1 2
3 2
Supported by
https://codeforces.com/problemset/problem/1651/D 2/2