Problem
A signed permutation of length is some ordering of the positive integers in which each integer is then provided with either a positive or negative sign (for the sake of simplicity, we omit the positive sign). For example, is a signed permutation of length .
Given: A positive integer .
Return: The total number of signed permutations of length , followed by a list of all such permutations (you may list the signed permutations in any order).
长度的有符号排列 是正整数的一些排序 然后为每个整数提供一个正号或负号(为简单起见,我们省略了正号)。例如, 是长度的有符号排列 。
给定:正整数。
返回:长度的有符号排列总数,然后是所有此类排列的列表(您可以按任何顺序列出带符号的排列)。
Sample Dataset
2
Sample Output
8 -1 -2 -1 2 1 -2 1 2 -2 -1 -2 1 2 -1 2 1