実行時間制限: 2 sec / メモリ制限: 1024 MiB
配点 : 100 点
問題文
<, =, > のみからなる文字列 S が与えられます。
S が 双方向矢印型 の文字列であるか判定してください。
ただし、文字列 S が双方向矢印型の文字列であるとは、
ある正整数 k が存在して、
S が 1 個の < 、k 個の = 、1 個の > をこの順に連結した長さ (k+2) の文字列であることをいいます。
制約
- S は
<,=,>のみからなる長さ 3 以上 100 以下の文字列
入力
入力は以下の形式で標準入力から与えられる。
S
出力
S が 双方向矢印型 の文字列ならば Yes を、そうでないならば No を出力せよ。
入力例 1
<====>
出力例 1
Yes
<====> は、1 個の < 、4 個の = 、1 個の > をこの順に連結した文字列であり、双方向矢印型の文字列です。
よって、Yes を出力します。
入力例 2
==>
出力例 2
No
==> は双方向矢印型の文字列の条件をみたしていません。
よって、No を出力します。
入力例 3
<>>
出力例 3
No
Scoring: 100 points
Problem Statement
You are given a string S consisting of <, =, and >.
Determine whether S is a bidirectional arrow string.
A string S is a bidirectional arrow string if and only if there is a positive integer k such that S is a concatenation of one <, k =s, and one >, in this order, with a length of (k+2).
Constraints
- S is a string of length between 3 and 100, inclusive, consisting of
<,=, and>.
Input
The input is given from Standard Input in the following format:
S
Output
If S is a bidirectional arrow string, print Yes; otherwise, print No.
Sample Input 1
<====>
Sample Output 1
Yes
<====> is a concatenation of one <, four =s, and one >, in this order, so it is a bidirectional arrow string.
Hence, print Yes.
Sample Input 2
==>
Sample Output 2
No
==> does not meet the condition for a bidirectional arrow string.
Hence, print No.
Sample Input 3
<>>
Sample Output 3
No
実行時間制限: 2 sec / メモリ制限: 1024 MiB
配点 : 100 点
問題文
高橋くんは、N 個の品物と 1 つのカバンを持っています。
i 番目 (1\le i\le N) の品物の大きさは A _ i で、カバンの大きさは M です。
カバンに入れようとしている品物の大きさの合計が M 以下のとき、かつそのときに限り、それらの品物をすべて同時にカバンに入れることができます。
高橋くんが N 個の品物すべてを同時にカバンに入れることができるなら Yes 、そうでなければ No と出力してください。
制約
- 1\le N\le100
- 1\le M\le10000
- 1\le A _ i\le100\ (1\le i\le N)
- 入力はすべて整数
入力
入力は以下の形式で標準入力から与えられる。
N M A _ 1 A _ 2 \ldots A _ N
出力
高橋くんがすべての品物を同時にカバンに入れられるなら Yes を、そうでなければ No を出力せよ。
入力例 1
5 15 3 1 4 1 5
出力例 1
Yes
5 つの品物の大きさの合計は 3+1+4+1+5=14 です。
これは、カバンの大きさ 15 以下なので、高橋くんはすべての品物を同時にカバンに入れることができます。
なので、Yes を出力してください。
入力例 2
5 5 3 1 4 1 5
出力例 2
No
5 つの品物の大きさの合計は 14 で、カバンの大きさ 5 より大きいため、高橋くんはすべての品物を同時にカバンに入れることができません。
なので、No を出力してください。
入力例 3
1 10000 100
出力例 3
Yes
Score : 100 points
Problem Statement
Takahashi has N items and one bag.
The size of the i-th (1\le i\le N) item is A_i, and the size of the bag is M.
If and only if the total size of the items he is trying to put in the bag is at most M, he can put all those items in the bag simultaneously.
If he can put all N items in the bag simultaneously, print Yes; otherwise, print No.
Constraints
- 1\le N\le100
- 1\le M\le10000
- 1\le A_i\le100\ (1\le i\le N)
- All input values are integers.
Input
The input is given from standard input in the following format:
N M A_1 A_2 \ldots A_N
Output
If Takahashi can put all items in the bag simultaneously, print Yes; otherwise, print No.
Sample Input 1
5 15 3 1 4 1 5
Sample Output 1
Yes
The total size of the 5 items is 3+1+4+1+5=14.
Since this is not greater than the bag size 15, Takahashi can put all items in the bag simultaneously.
Thus, print Yes.
Sample Input 2
5 5 3 1 4 1 5
Sample Output 2
No
The total size of the 5 items is 14, which is greater than the bag size 5, so he cannot put all items in the bag simultaneously.
Thus, print No.
Sample Input 3
1 10000 100
Sample Output 3
Yes
実行時間制限: 2 sec / メモリ制限: 1024 MiB
配点 : 200 点
問題文
次の図に示す、各マスが黒または白に塗られた縦 15 行 \times 横 15 列のグリッドにおいて、 上から R 行目、左から C 列目のマスが何色かを出力して下さい。

制約
- 1 \leq R, C \leq 15
- R, C は整数
入力
入力は以下の形式で標準入力から与えられる。
R C
出力
図のグリッドにおいて上から R 行目、左から C 列目のマスが黒色の場合は black と、白色の場合は white と出力せよ。
ジャッジは英小文字と英大文字を厳密に区別することに注意せよ。
入力例 1
3 5
出力例 1
black
図のグリッドにおいて上から 3 行目、左から 5 列目のマスは黒色です。
よって、black と出力します。
入力例 2
4 5
出力例 2
white
図のグリッドにおいて上から 4 行目、左から 5 列目のマスは白色です。
よって、white と出力します。
Score : 200 points
Problem Statement
Print the color of the cell at the R-th row from the top and C-th column from the left in the following grid with 15 vertical rows and 15 horizontal columns.

Constraints
- 1 \leq R, C \leq 15
- R and C are integers.
Input
Input is given from Standard Input in the following format:
R C
Output
In the grid above, if the color of the cell at the R-th row from the top and C-th column from the left is black, then print black; if the cell is white, then print white. Note that the judge is case-sensitive.
Sample Input 1
3 5
Sample Output 1
black
In the grid above, the cell at the 3-rd row from the top and 5-th column from the left is black. Thus, black should be printed.
Sample Input 2
4 5
Sample Output 2
white
In the grid above, the cell at the 4-th row from the top and 5-th column from the left is white. Thus, white should be printed.
実行時間制限: 2 sec / メモリ制限: 1024 MiB
配点 : 200 点
問題文
長さ N の正整数列 A=(A_1,A_2,\ldots,A_N) が与えられます。
1\leq l\leq r\leq N をみたす整数の組 (l,r) であって、
次の条件をみたすものの個数を求めてください。
l\leq i\leq r をみたす任意の整数 i について、A_i は A_l+A_{l+1}+\cdots+A_r の約数でない。
制約
- 1 \leq N \leq 50
- 1 \leq A_i \leq 1000
- 入力はすべて整数
入力
入力は以下の形式で標準入力から与えられる。
N A_1 A_2 \ldots A_N
出力
答えを出力せよ。
入力例 1
5 8 6 10 5 7
出力例 1
6
A=(8,6,10,5,7) です。
例えば、(l,r)=(1,2) は、A_l+A_{l+1}+\cdots+A_r=A_1+A_2=14 であり、A_1=8, A_2=6 はどちらも 14 の約数でないため、条件をみたします。
一方で、(l,r)=(1,3) は、A_l+A_{l+1}+\cdots+A_r=A_1+A_2+A_3=24 であり、A_1=8 が 24 の約数であるため、条件をみたしません。
条件をみたす組は (l,r)=(1,2), (1,4), (2,3), (2,4), (3,5), (4,5) の 6 つであるため、6 を出力します。
入力例 2
3 1 1 1
出力例 2
0
Score : 200 points
Problem Statement
You are given a sequence of positive integers A=(A_1,A_2,\ldots,A_N) of length N.
Find the number of pairs of integers (l,r) satisfying 1\leq l\leq r\leq N that satisfy the following condition:
For every integer i satisfying l\leq i\leq r, A_i is not a divisor of A_l+A_{l+1}+\cdots+A_r.
Constraints
- 1 \leq N \leq 50
- 1 \leq A_i \leq 1000
- All input values are integers.
Input
The input is given from Standard Input in the following format:
N A_1 A_2 \ldots A_N
Output
Output the answer.
Sample Input 1
5 8 6 10 5 7
Sample Output 1
6
We have A=(8,6,10,5,7).
For example, (l,r)=(1,2) satisfies the condition because A_l+A_{l+1}+\cdots+A_r=A_1+A_2=14, and neither A_1=8 nor A_2=6 is a divisor of 14.
On the other hand, (l,r)=(1,3) does not satisfy the condition because A_l+A_{l+1}+\cdots+A_r=A_1+A_2+A_3=24, and A_1=8 is a divisor of 24.
The pairs that satisfy the condition are (l,r)=(1,2), (1,4), (2,3), (2,4), (3,5), (4,5), which is six pairs, so output 6.
Sample Input 2
3 1 1 1
Sample Output 2
0
実行時間制限: 2 sec / メモリ制限: 1024 MiB
配点 : 300 点
問題文
長さ N の正整数列 A=(A_1,A_2,\dots,A_N) が与えられます。
1\leq l\leq r\leq N を満たす整数の組 (l,r) であって、数列 (A_l,A_{l+1},\dots,A_r) が等差数列であるようなものが何通りあるか求めてください。
なお、数列 (x_1,x_2,\dots,x_{|x|}) が等差数列であるとは、ある d が存在して x_{i+1}-x_i=d\ (1\leq i < |x|) であることをいいます。 特に、長さ 1 の数列は常に等差数列です。
制約
- 1\leq N \leq 2\times 10^5
- 1\leq A_i \leq 10^9
- 入力は全て整数
入力
入力は以下の形式で標準入力から与えられる。
N A_1 A_2 \dots A_N
出力
答えを出力せよ。
入力例 1
4 3 6 9 3
出力例 1
8
条件を満たす整数の組 (l,r) は (1,1),(2,2),(3,3),(4,4),(1,2),(2,3),(3,4),(1,3) の 8 通りです。
実際、(l,r)=(1,3) のとき (A_l,\dots,A_r)=(3,6,9) は等差数列なので条件を満たしますが、 (l,r)=(2,4) のとき (A_l,\dots,A_r)=(6,9,3) は等差数列ではないので条件を満たしません。
入力例 2
5 1 1 1 1 1
出力例 2
15
すべての整数の組 (l,r)\ (1\leq l\leq r\leq 5) が条件を満たします。
入力例 3
8 87 42 64 86 72 58 44 30
出力例 3
22
Score : 300 points
Problem Statement
You are given a sequence of N positive integers A=(A_1,A_2,\dots,A_N).
Find the number of pairs of integers (l,r) satisfying 1\leq l\leq r\leq N such that the subsequence (A_l,A_{l+1},\dots,A_r) forms an arithmetic progression.
A sequence (x_1,x_2,\dots,x_{|x|}) is an arithmetic progression if and only if there exists a d such that x_{i+1}-x_i=d\ (1\leq i < |x|). In particular, a sequence of length 1 is always an arithmetic progression.
Constraints
- 1\leq N \leq 2\times 10^5
- 1\leq A_i \leq 10^9
- All input values are integers.
Input
The input is given from Standard Input in the following format:
N A_1 A_2 \dots A_N
Output
Print the answer.
Sample Input 1
4 3 6 9 3
Sample Output 1
8
There are eight pairs of integers (l,r) satisfying the condition: (1,1),(2,2),(3,3),(4,4),(1,2),(2,3),(3,4),(1,3).
Indeed, when (l,r)=(1,3), (A_l,\dots,A_r)=(3,6,9) is an arithmetic progression, so it satisfies the condition. However, when (l,r)=(2,4), (A_l,\dots,A_r)=(6,9,3) is not an arithmetic progression, so it does not satisfy the condition.
Sample Input 2
5 1 1 1 1 1
Sample Output 2
15
All pairs of integers (l,r)\ (1\leq l\leq r\leq 5) satisfy the condition.
Sample Input 3
8 87 42 64 86 72 58 44 30
Sample Output 3
22
実行時間制限: 2 sec / メモリ制限: 1024 MiB
配点 : 300 点
問題文
N 個の商品があります。i = 1, 2, \ldots, N について、i 番目の商品の値段は A_i 円です。
高橋君は K 枚のクーポンを持っています。
1 枚のクーポンは 1 つの商品に対して使用することができ、1 つの商品に対してはクーポンを何枚でも( 0 枚でもよい)使用することができます。
値段が a 円の商品に対して k 枚のクーポンを使用すると、その商品を \max\lbrace a - kX, 0\rbrace 円で買うことができます。
高橋君がすべての商品を買うために支払う合計金額の最小値を出力してください。
制約
- 1 \leq N \leq 2 \times 10^5
- 1 \leq K, X \leq 10^9
- 1 \leq A_i \leq 10^9
- 入力はすべて整数
入力
入力は以下の形式で標準入力から与えられる。
N K X A_1 A_2 \ldots A_N
出力
答えを出力せよ。
入力例 1
5 4 7 8 3 10 5 13
出力例 1
12
1 番目の商品に対してクーポン 1 枚、3 番目の商品に対してクーポン 1 枚、5 番目の商品に対してクーポン 2 枚を使用すると、
- 1 番目の商品を \max\lbrace A_1-X, 0 \rbrace = 1 円で買うことができ、
- 2 番目の商品を \max\lbrace A_2, 0 \rbrace = 3 円で買うことができ、
- 3 番目の商品を \max\lbrace A_3-X, 0 \rbrace = 3 円で買うことができ、
- 4 番目の商品を \max\lbrace A_4, 0 \rbrace = 5 円で買うことができ、
- 5 番目の商品を \max\lbrace A_5-2X, 0 \rbrace = 0 円で買うことができます。
よって、すべての商品を 1 + 3 + 3 + 5 + 0 = 12 円で買うことができ、これが最小です。
入力例 2
5 100 7 8 3 10 5 13
出力例 2
0
入力例 3
20 815 60 2066 3193 2325 4030 3725 1669 1969 763 1653 159 5311 5341 4671 2374 4513 285 810 742 2981 202
出力例 3
112
Score : 300 points
Problem Statement
There are N items in a shop. For each i = 1, 2, \ldots, N, the price of the i-th item is A_i yen (the currency of Japan).
Takahashi has K coupons.
Each coupon can be used on one item. You can use any number of coupons, possibly zero, on the same item. Using k coupons on an item with a price of a yen allows you to buy it for \max\lbrace a - kX, 0\rbrace yen.
Print the minimum amount of money Takahashi needs to buy all the items.
Constraints
- 1 \leq N \leq 2 \times 10^5
- 1 \leq K, X \leq 10^9
- 1 \leq A_i \leq 10^9
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
N K X A_1 A_2 \ldots A_N
Output
Print the answer.
Sample Input 1
5 4 7 8 3 10 5 13
Sample Output 1
12
By using 1 coupon on the 1-st item, 1 coupon on the 3-rd item, and 2 coupons on the 5-th item, Takahashi can:
- buy the 1-st item for \max\lbrace A_1-X, 0 \rbrace = 1 yen,
- buy the 2-nd item for \max\lbrace A_2, 0 \rbrace = 3 yen,
- buy the 3-rd item for \max\lbrace A_3-X, 0 \rbrace = 3 yen,
- buy the 4-th item for \max\lbrace A_4, 0 \rbrace = 5 yen,
- buy the 5-th item for \max\lbrace A_5-2X, 0 \rbrace = 0 yen,
for a total of 1 + 3 + 3 + 5 + 0 = 12 yen, which is the minimum possible.
Sample Input 2
5 100 7 8 3 10 5 13
Sample Output 2
0
Sample Input 3
20 815 60 2066 3193 2325 4030 3725 1669 1969 763 1653 159 5311 5341 4671 2374 4513 285 810 742 2981 202
Sample Output 3
112
実行時間制限: 4 sec / メモリ制限: 1024 MiB
配点 : 400 点
問題文
2 次元平面上に N 個の相異なる点があり、1,2,\ldots ,N の番号がついています。点 i\,(1 \leq i \leq N) の座標は (x_i,y_i) です。
これらの点のうち 4 つを頂点とし、全ての辺が x 軸または y 軸に平行であるような長方形はいくつありますか?
制約
- 4 \leq N \leq 2000
- 0 \leq x_i, y_i \leq 10^9
- (x_i,y_i) \neq (x_j,y_j) (i \neq j)
- 入力は全て整数である。
入力
入力は以下の形式で標準入力から与えられる。
N x_1 y_1 x_2 y_2 \vdots x_N y_N
出力
答えを出力せよ。
入力例 1
6 0 0 0 1 1 0 1 1 2 0 2 1
出力例 1
3
点 1 、点 2 、点 3 、点 4 を頂点とする長方形、
点 1 、点 2 、点 5 、点 6 を頂点とする長方形、
点 3 、点 4 、点 5 、点 6 を頂点とする長方形
の合計 3 つです。
入力例 2
4 0 1 1 2 2 3 3 4
出力例 2
0
入力例 3
7 0 1 1 0 2 0 2 1 2 2 3 0 3 2
出力例 3
1
Score : 400 points
Problem Statement
We have N distinct points on a two-dimensional plane, numbered 1,2,\ldots,N. Point i (1 \leq i \leq N) has the coordinates (x_i,y_i).
How many rectangles are there whose vertices are among the given points and whose edges are parallel to the x- or y-axis?
Constraints
- 4 \leq N \leq 2000
- 0 \leq x_i, y_i \leq 10^9
- (x_i,y_i) \neq (x_j,y_j) (i \neq j)
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
N x_1 y_1 x_2 y_2 \vdots x_N y_N
Output
Print the answer.
Sample Input 1
6 0 0 0 1 1 0 1 1 2 0 2 1
Sample Output 1
3
There are three such rectangles:
the rectangle whose vertices are Points 1, 2, 3, 4,
the rectangle whose vertices are Points 1, 2, 5, 6,
and the rectangle whose vertices are Points 3, 4, 5, 6.
Sample Input 2
4 0 1 1 2 2 3 3 4
Sample Output 2
0
Sample Input 3
7 0 1 1 0 2 0 2 1 2 2 3 0 3 2
Sample Output 3
1
実行時間制限: 2 sec / メモリ制限: 1024 MiB
配点 : 475 点
問題文
A 個のリンゴと B 個のオレンジと C 個のバナナと D 個のブドウがあります。
これらの A+B+C+D 個の果物を、以下の条件全てを満たすように左右一列に並べる方法は何通りありますか?答えを 998244353 で割った余りを求めてください。
- リンゴはすべて、バナナよりも左側に並べる。
- リンゴはすべて、ブドウよりも左側に並べる。
- オレンジはすべて、ブドウよりも左側に並べる。
ただし、同じ種類の果物同士は区別できないとします。
制約
- 1 \leq A \leq 10^6
- 1 \leq B \leq 10^6
- 1 \leq C \leq 10^6
- 1 \leq D \leq 10^6
- A, B, C, D は全て整数
入力
入力は以下の形式で標準入力から与えられる。
A B C D
出力
果物を問題文の条件を満たすように左右一列に並べる方法の個数を 998244353 で割った余りを出力せよ。
入力例 1
1 1 1 1
出力例 1
5
問題文の条件を満たす果物の並べ方は次の 5 通りです。
- リンゴ, オレンジ, バナナ, ブドウ
- リンゴ, オレンジ, ブドウ, バナナ
- リンゴ, バナナ, オレンジ, ブドウ
- オレンジ, リンゴ, バナナ, ブドウ
- オレンジ, リンゴ, ブドウ, バナナ
入力例 2
1 2 4 8
出力例 2
2211
入力例 3
834150 21994 467364 994225
出力例 3
947921688
Score : 475 points
Problem Statement
You have A apples, B oranges, C bananas, and D grapes.
How many ways are there to arrange these A+B+C+D fruits in a single row from left to right so that all of the following conditions hold? Find the count modulo 998244353.
- Every apple is placed to the left of every banana.
- Every apple is placed to the left of every grape.
- Every orange is placed to the left of every grape.
Here, the apples are indistinguishable; the same goes for the oranges, the bananas, and the grapes.
Constraints
- 1 \le A \le 10^6
- 1 \le B \le 10^6
- 1 \le C \le 10^6
- 1 \le D \le 10^6
- A, B, C, and D are integers.
Input
The input is given from Standard Input in the following format:
A B C D
Output
Output the number, modulo 998244353, of valid arrangements.
Sample Input 1
1 1 1 1
Sample Output 1
5
There are five valid arrangements:
- apple, orange, banana, grape
- apple, orange, grape, banana
- apple, banana, orange, grape
- orange, apple, banana, grape
- orange, apple, grape, banana
Sample Input 2
1 2 4 8
Sample Output 2
2211
Sample Input 3
834150 21994 467364 994225
Sample Output 3
947921688
実行時間制限: 2 sec / メモリ制限: 1024 MiB
配点 : 525 点
問題文
2 次元平面上に 1 から N の番号がついた N カ所の地点があります。地点 i は座標 (X_i, Y_i) にあります。
あなたは地点 1 を出発して全ての地点をちょうど 1 回ずつ巡回して再び地点 1 に戻ることにしました。
ここで、地点 i から地点 j へ移動するには \vert X_i - X_j \vert + \vert Y_i - Y_j \vert 秒かかります。
地点 1 を出発してから 10^{10} 秒以内に全ての地点を巡回して再び地点 1 に戻ることができる経路を出力してください。なお、制約下においてこの条件を満たす経路が少なくとも 1 つ存在することが保証されます。
制約
- 1 \leq N \leq 6 \times 10^4
- 0 \leq X_i \leq 2 \times 10^7
- 0 \leq Y_i \leq 2 \times 10^7
- i \neq j ならば (X_i, Y_i) \neq (X_j, Y_j)
- 入力される値は全て整数
入力
入力は以下の形式で標準入力から与えられる。
N X_1 Y_1 X_2 Y_2 \vdots X_N Y_N
出力
i (1 \leq i \leq N) 番目に訪問する地点を p_i として以下の形式で答えを出力せよ。
p_1 p_2 \dots p_N
出力された答えは、以下の条件を全て満たす時に正答とみなされる。
- (p_1, p_2, \dots, p_N) は (1, 2, \dots, N) の順列
- p_1 = 1
- d(i, j) を地点 i から地点 j へ移動する時にかかる秒数としたとき、\displaystyle \sum_{i=1}^N d(p_i, p_{(i \bmod N) + 1} ) \leq 10^{10}
答えが複数ある場合はどれを出力しても正解とみなされる。
入力例 1
3 0 6 3 5 2 4
出力例 1
1 3 2
\displaystyle \sum_{i=1}^N d(p_i, p_{(i \bmod N) + 1}) = 4 + 2 + 4 = 10 であるため出力は条件を満たします。
入力例 2
10 9706344 19786176 19341349 15565412 5711023 19068083 12521132 14054301 14767612 17088029 14961700 18526945 13801766 5740101 6581153 8643675 13176196 16586661 4086263 5172719
出力例 2
1 5 2 6 4 7 9 8 3 10
Score : 525 points
Problem Statement
There are N locations numbered 1 to N on a two-dimensional plane. Location i is at coordinates (X_i, Y_i).
You will start from location 1, visit every location exactly once, and return to location 1.
Moving from location i to location j takes \vert X_i - X_j \vert + \vert Y_i - Y_j \vert seconds.
Output a route that visits all locations and returns to location 1 within 10^{10} seconds of starting from location 1. It is guaranteed that at least one such route exists under the given constraints.
Constraints
- 1 \leq N \leq 6 \times 10^4
- 0 \leq X_i \leq 2 \times 10^7
- 0 \leq Y_i \leq 2 \times 10^7
- (X_i, Y_i) \neq (X_j, Y_j) if i \neq j
- All input values are integers.
Input
The input is given from Standard Input in the following format:
N X_1 Y_1 X_2 Y_2 \vdots X_N Y_N
Output
Let p_i be the i-th location visited (1 \leq i \leq N), and output your answer in the following format.
p_1 p_2 \dots p_N
Your answer is considered correct if all of the following conditions are satisfied.
- (p_1, p_2, \dots, p_N) is a permutation of (1, 2, \dots, N).
- p_1 = 1
- Letting d(i, j) be the number of seconds it takes to move from location i to location j, \displaystyle \sum_{i=1}^N d(p_i, p_{(i \bmod N) + 1} ) \leq 10^{10}.
If there are multiple valid answers, any of them will be accepted.
Sample Input 1
3 0 6 3 5 2 4
Sample Output 1
1 3 2
\displaystyle \sum_{i=1}^N d(p_i, p_{(i \bmod N) + 1}) = 4 + 2 + 4 = 10, so the output satisfies the condition.
Sample Input 2
10 9706344 19786176 19341349 15565412 5711023 19068083 12521132 14054301 14767612 17088029 14961700 18526945 13801766 5740101 6581153 8643675 13176196 16586661 4086263 5172719
Sample Output 2
1 5 2 6 4 7 9 8 3 10