Codeforces Round 965 (Div. 2)
A
Find K Distinct Points with Fixed Center
Codeforces
800
原题
←B →
翻译中…

I couldn't think of a good title for this problem, so I decided to learn from LeetCode.— Sun Tzu, The Art of War

翻译中…

You are given three integers $x_c$, $y_c$, and $k$ ($-100 \leq x_c, y_c \leq 100$, $1 \leq k \leq 1000$).

翻译中…

You need to find $k$ distinct points ($x_1, y_1$), ($x_2, y_2$), $\ldots$, ($x_k, y_k$), having integer coordinates, on the 2D coordinate plane such that:

翻译中…
  • their center$^{\text{∗}}$ is ($x_c, y_c$)
  • $-10^9 \leq x_i, y_i \leq 10^9$ for all $i$ from $1$ to $k$
翻译中…

It can be proven that at least one set of $k$ distinct points always exists that satisfies these conditions.

翻译中…

$^{\text{∗}}$The center of $k$ points ($x_1, y_1$), ($x_2, y_2$), $\ldots$, ($x_k, y_k$) is $\left( \frac{x_1 + x_2 + \ldots + x_k}{k}, \frac{y_1 + y_2 + \ldots + y_k}{k} \right)$.

翻译中…

Input

翻译中…

The first line contains $t$ ($1 \leq t \leq 100$) — the number of test cases.

翻译中…

Each test case contains three integers $x_c$, $y_c$, and $k$ ($-100 \leq x_c, y_c \leq 100$, $1 \leq k \leq 1000$) — the coordinates of the center and the number of distinct points you must output.

翻译中…

It is guaranteed that the sum of $k$ over all test cases does not exceed $1000$.

翻译中…

Output

翻译中…

For each test case, output $k$ lines, the $i$-th line containing two space separated integers, $x_i$ and $y_i$, ($-10^9 \leq x_i, y_i \leq 10^9$) — denoting the position of the $i$-th point.

翻译中…

If there are multiple answers, print any of them. It can be shown that a solution always exists under the given constraints.

翻译中…

Note

翻译中…

For the first test case, $\left( \frac{10}{1}, \frac{10}{1} \right) = (10, 10)$.

翻译中…

For the second test case, $\left( \frac{-1 + 5 - 4}{3}, \frac{-1 -1 + 2}{3} \right) = (0, 0)$.

翻译中…

样例

Input #1
4
10 10 1
0 0 3
-5 -8 8
4 -5 3
Output #1
10 10
-1 -1
5 -1
-4 2
-6 -7
-5 -7
-4 -7
-4 -8
-4 -9
-5 -9
-6 -9
-6 -8
1000 -1000
-996 995
8 -10
InputCopy OutputCopy
题目信息
题号
1998A
时间限制
1 s
内存限制
256 MB
标签
构造
模拟
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。