# 1つ前の生徒との差分を xiとする # x1 + x1+x2+K + x1+x2+K+x3+K + x1+x2+x3+2K+x4+K + ... = S # <=> Nx1 + (N-1)x2 + (N-2)x3 + ... + xN + K*N(N-1)/2 = S N, S, K = map(int, input().split()) mod = 10**9 + 7 S -= K*N*(N-1)//2 if S < 0: print(0) quit() dp = [0] * (S+1) dp[0] = 1 for i in range(N): c = N - i nex = [0] * (S+1) for j in range(S+1): for jj in range(0, S+1, c): if j + jj > S: break nex[j+jj] += dp[j] nex[j+jj] %= mod dp = nex print(dp[-1])