Product sum#1088

Product sum

1 second
64 megabytes
Easy

Given a set of variables x_1, x_2, \ldots, x_N. Each variable x_i can take on only the values , , or . For a given integer , determine the number of ways to assign values to the variables x_i such that the sum of all possible products x_i \cdot x_j is equal to , where i < j and i, j = 1, 2, \ldots, N. Two ways are considered different if they contain a different number of x_i = 0.

Input

The first line contains the numbers and , separated by space.

2 \leq N \leq 10000, -10000 < S < 10000.

Output

Print a single integer — the number of ways to represent as a sum of products.

Examples

Example 1

Loading
Loading