201170: [AtCoder]ARC117 A - God Sequence

Memory Limit:1024 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score : $200$ points

Problem Statement

A sequence of length $A + B$, $E = (E_1, E_2, \dots, E_{A+B})$, that satisfies all of the conditions below is said to be a god sequence.

  • $E_1 + E_2 + \cdots + E_{A+B} = 0$ holds.
  • There are exactly $A$ positive integers among $E_1, E_2, \dots, E_{A+B}$.
  • There are exactly $B$ negative integers among $E_1, E_2, \dots, E_{A+B}$.
  • $E_1, E_2, \dots, E_{A+B}$ are all distinct.
  • $-10^{9} \leq E_i \leq 10^9, E_i \neq 0$ holds for every $i$ $(1 \leq i \leq A+B)$.

Construct one god sequence.

We can prove that at least one god sequence exists under Constraints of this problem.

Constraints

  • $1 \leq A \leq 1000$
  • $1 \leq B \leq 1000$
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

$A$ $B$

Output

Print the elements of your sequence in one line, with space as separator.

If there are multiple god sequences, any of them will be accepted.

$E_1$ $E_2$ $\cdots$ $E_{A+B}$

Sample Input 1

1 1

Sample Output 1

1001 -1001

A sequence $(1001, -1001)$ contains $A=1$ positive integer and $B=1$ negative integer totaling $1001+(-1001)=0$.

It also satisfies the other conditions and thus is a god sequence.


Sample Input 2

1 4

Sample Output 2

-8 -6 -9 120 -97

A sequence $(-8, -6, -9, 120, -97)$ contains $A=1$ positive integer and $B=4$ negative integers totaling $(-8)+(-6)+(-9)+120+(-97)=0$.

It also satisfies the other conditions and thus is a god sequence.


Sample Input 3

7 5

Sample Output 3

323 -320 411 206 -259 298 -177 -564 167 392 -628 151

Input

加入题单

上一题 下一题 算法标签: