luogu#P16360. [BalticOI 2026] Distances
[BalticOI 2026] Distances
Problem Description
You are given integers and . Your goal is to pick distinct integer points on the -plane such that for exactly pairs of points, the Euclidean distance between the points is an integer. Recall that the Euclidean distance between points and is
It can be shown that a solution always exists under the constraints of this task.
Input Format
The only line contains two integers, and .
Output Format
Print lines with the th line containing two integers: the and coordinates of the th point. The absolute value of every coordinate must be at most .
If there are multiple solutions, you can print any of them.
3 2
1 1
1 2
2 2
Hint
Explanation
The Euclidean distance between and is . The distance between and is also . However, the distance between and is , which is not an integer.
Constraints
Scoring
| Subtask | Constraints | Points |
|---|---|---|
| 1 | ||
| 2 | ||
| 3 | ||
| 4 | ||
| 5 | ||
| 6 | No additional constraints |