logo AlgoBeat OnlineJudge
登录 注册

#216418. [BalticOI 2026] Distances

内存限制:512 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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.

输入格式

The only line contains two integers, and .

输出格式

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.

样例

样例输入 1

3 2

样例输出 1

1 1
1 2
2 2

数据范围与提示

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