import std.stdio, std.array, std.string, std.conv, std.algorithm; import std.typecons, std.range, std.random, std.math, std.container; import std.numeric, std.bigint, core.bitop, core.stdc.stdio; void main() { immutable long MOD = 10^^9+7; int N, S, K; scanf("%d %d %d", &N, &S, &K); auto dp = new long[][](N, S+1); foreach (i; 0..N) foreach (j; 0..S+1) dp[i][j] = 0; foreach (i; 0..S+1) { auto s = N * (N-1) * K / 2 + i * N; if (s > S) break; dp[0][s] = 1; } foreach (i; 0..N-1) { foreach (j; 0..S+1) { if (dp[i][j] == 0) continue; foreach (x; 0..S+1) { // (i+1)人目が(K+x)円増やす auto incr = (N-i-1) * x; if (j + incr > S) break; (dp[i+1][j+incr] += dp[i][j]) %= MOD; } } } dp[N-1][S].writeln; }