N, A = [int(_) for _ in input().split()]

X = [int(_) - A for _ in input().split()]

dp = [0] * 3000 + [1] + [0] * 3000

for x in X:

    dp_old = dp.copy()

    for i in range(max(-x, 0), min(6001, 6001 - x)):

        dp[i + x] += dp_old[i]

print((dp[3000] - 1))

N, A = [int(_) for _ in input().split()]

X = [int(_) - A for _ in input().split()]

M = max(X + [A])

dp = [0] * (2 * N * M + 1)

dp[N * M] = 1

for x in X:

    dp_old = dp.copy()

    for i in range(max(-x, 0), min(2 * N * M + 1, 2 * N * M + 1 - x)):

        dp[i + x] += dp_old[i]

print((dp[N * M] - 1))

N, A = [int(_) for _ in input().split()]
X = [int(_) - A for _ in input().split()]
dp = [0] * 3000 + [1] + [0] * 3000
for x in X:
    dp_old = dp.copy()
    for i in range(max(-x, 0), min(6001, 6001 - x)):
        dp[i + x] += dp_old[i]
print((dp[3000] - 1))

N, A = [int(_) for _ in input().split()]
X = [int(_) - A for _ in input().split()]
M = max(X + [A])
dp = [0] * (2 * N * M + 1)
dp[N * M] = 1
for x in X:
    dp_old = dp.copy()
    for i in range(max(-x, 0), min(2 * N * M + 1, 2 * N * M + 1 - x)):
        dp[i + x] += dp_old[i]
print((dp[N * M] - 1))

-dp = [0] * 3000 + [1] + [0] * 3000 +M = max(X + [A]) +dp = [0] * (2 * N * M + 1) +dp[N * M] = 1 -    for i in range(max(-x, 0), min(6001, 6001 - x)): +    for i in range(max(-x, 0), min(2 * N * M + 1, 2 * N * M + 1 - x)): -print((dp[3000] - 1)) +print((dp[N * M] - 1))