1805. Easy Equation

时间限制 1000 ms   内存限制 512 MB

Given an integer $k$ greater than $1$, it is possible to prove that there are infinitely many triples of positive integers $( a, b, c )$ that satisfy the following equation: $a^2 + b^2 + c^2 = k ( ab + bc + ca ) + 1$. Given positive integers $n$ and $k$, find $n$ arbitrary triples $( a_1 , b_1 , c_1 ) , ( a_2 , b_2 , c_2 ) , ..., ( a_n , b_n , c_n )$ that all satisfy the equation. Furthermore, all $3n$ integers $a_1, ..., a_n, b_1 , ..., b_n, c_1, ..., c_n$ should be different positive integers with at most $100$ decimal digits each.

输入数据

The first line contains two integers $k$ and $n (2 ≤ k ≤ 1 000, 1 ≤ n ≤ 1 000)$ — the constant $k$ in the equation and the target number of triples.

输出数据

Output $n$ lines. The $i$-th line should contain three space separated integers $a_i, b_i$ and $c_i$ with at most $100$ digits each — the $i$-th of the solutions you found.

样例输入

复制
2 8 · \n

样例输出 special judge

复制
1 2 6
3 10 24
12 35 88
15 28 84
4 5 18
14 33 90
40 104 273
21 60 152 · · \n
 ·  ·  \n
  ·  ·  \n
  ·  ·  \n
 · ·  \n
  ·  ·  \n
  ·   ·   \n
  ·  ·   \n

提交

请先 登录

© 2026 FAQs Contact About