No.1837 Same but Different
タグ : / 解いたユーザー数 57
作問者 :
Sumitacchan
/ テスター :
👑
hitonanode
Problem Statement
You are given an integer $N$ between $3$ and $3000$, inclusive.
Find $1$ pair of $2$ non-negative integer sequences of length $N$, $A=(A_1,A_2,\dots,A_N),B=(B_1,B_2,\dots,B_N)$, that satisfies all of the following conditions.
- $0\le A_1 < A_2 < \dots < A_N \le 10000$
- $0\le B_1 < B_2 < \dots < B_N \le 10000$
- $A_1+A_2+\dots +A_N=B_1+B_2+\dots +B_N$
- For any tuple of integers $i,j,k,l$ between $1$ and $N$, inclusive, $A_i+A_j \ne B_k+B_l$
(Note: $i,j,k,l$ are not necessarily distinct.)
It can be shown that $A,B$ satisfying the conditions always exist under the given constraints.
Input
$N$
- $3\le N\le 3000$
- All inputs are integers.
Output
Output in the following format.
$A_1\ \ A_2\ \ \cdots\ \ A_N$ $B_1\ \ B_2\ \ \cdots\ \ B_N$If there are multiple answers, any of them will be accepted.
Sample
Sample 1
Input
3
Output
99 824 4353 0 1 5275
In this sample output, $A_1+A_2+A_3=B_1+B_2+B_3\ (=5276)$ holds.
Also, there are $3^4$ tuples of integers $i,j,k,l$ between $1$ and $3$, inclusive, and $A_i+A_j \ne B_k+B_l$ holds for all of them.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。