Type: Default 1000ms 256MiB

零的数列

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

请考虑一个由 11NN 的数字组成的递增数列:1,2,3,,N1, 2, 3, \ldots, N

现在请在数列中插入 + 表示加,或者 - 表示减,(空格) 表示空白(例如 1-2 3 就等于 1-23),来将每一对数字组合在一起(请不要在第一个数字前插入符号)。

计算该表达式的结果并判断其值是否为 00。 请你写一个程序找出所有产生和为零的长度为N的数列。

Format

Input

单独的一行表示整数 NN3N93 \leq N \leq 9)。

Output

按照 ASCII码的顺序,输出所有在每对数字间插入 +,-,(空格) 后能得到结果为零的数列。

Samples

7
1+2-3+4-5-6+7
1+2-3-4+5+6-7
1-2 3+4+5+6+7
1-2 3-4 5+6 7
1-2+3+4-5+6-7
1-2-3-4-5+6+7

Limitation

1s, 1024KiB for each test case.

20241031周赛

Not Attended
Status
Done
Rule
IOI
Problem
6
Start at
2024-10-31 16:45
End at
2024-10-31 18:30
Duration
1.8 hour(s)
Host
Partic.
16