1221 表达式个数


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

1到N的序列: 1 2 3 4 5 ...N 每两个数之间插入 + 或 -,求其和恰为M的不同表达式个数。例如:N为7,M为0,则有: 1 + 2 - 3 + 4 - 5 - 6 + 7 = 0 1 + 2 - 3 - 4 + 5 + 6 - 7 = 0 1 - 2 + 3 + 4 - 5 + 6 - 7 = 0 1 - 2 - 3 - 4 - 5 + 6 + 7 = 0 所以N,M分别为7和0时,共有4种不同表达式。

Input

输入中有若干行数据。每行中包含两个整数N(1≤ N ≤ 13),M(0≤ M ≤ N(N+1)/2)。M表示在1到N之间的各个间隙,使用 + 或 - 操作符,以构成表达式所计算的值。

Output

对每个N和M,输出能够构成的表达式个数。如果没有,则应输出“NO”,每个结果占一行。

Sample

Input

7 0
3 2
2 1

Output

4
1
NO

Source: qianneng


Comments

There are no comments at the moment.