問題一覧 > 通常問題

No.1409 Simple Math in yukicoder

レベル : / AI推定難易度 : 2000 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : (AC するまで非表示) / 解いたユーザー数 57
作問者 : PCTprobability / テスター : akakimidori kaage
お気に入りにしたユーザー ProblemId : 5619 / 自分の提出
問題文最終更新日: 2021-02-26 21:32:42
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 284 (順位表) の他の問題:

Problem Statement

You are given positive integers $v,x$. It is guaranteed that $xv+1$ is prime. Find $1$ sequence of positive integers $a_1,a_2,...,a_x$ satisfying the following conditions.

  • $1$ $\le$ $a_1$ $<$ $a_2$ $<$ $...$ $<$ $a_x$ $\le$ $xv$
  • For every positive integer $k$ at least $1$ and less than $x$, \( \displaystyle \sum_{i=1}^{x}a_i^k \) is divisible by $xv+1$.
  • \( \displaystyle \sum_{i=1}^{x}a_i^x \) leaves a remainder of $x$ when divided by $xv+1$.

Output any valid sequence $a$, separated by spaces. It is guaranteed that a solution always exists.

In this problem, $T$ test cases are given.

Input

$T$
テストケース $1$
テストケース $2$
$.$$.$$.$
テストケース $T$
Each test case is given in the following format.
$v$ $x$

  • All inputs are positive integers.
  • $1 \le T,v \le 1000$
  • $1 \le x \le 100$
  • $xv+1$ is prime.

Output

Output $T$ lines. On the $i$-th line, output the answer for test case $i$.

Sample

Sample 1
Input
1
1 2
Output
1 2

In this case, $xv+1=3$. Here, $a_1=1,a_2=2$ is a solution, since it satisfies $1 \le a_1 < a_2 \le 2$, $1+2≡0 \bmod 3$, and $1^2+2^2≡2 \bmod 3$.

Sample

Sample 1
Input
3
2 6
2 1
6 7
Output
1 3 4 9 10 12
1
1 4 11 16 21 35 41

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。