const MOD: usize = 1e9 as usize + 7; fn main() { let mut ndk = String::new(); std::io::stdin().read_line(&mut ndk).ok(); let ndk: Vec = ndk.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let n = ndk[0]; let d = ndk[1]; let k = ndk[2]; let mut dp = vec![0usize]; dp[0] = 1; for i in 0..n { let start = i+1; let end = (i+1) * d; let mut next_dp = vec![0usize; end-start+1]; for j in 0..dp.len() { next_dp[j] += dp[j]; next_dp[j] %= MOD; if next_dp.len() > j+d { next_dp[j+d] += MOD - dp[j]; next_dp[j+d] %= MOD; } } for j in 1..next_dp.len() { next_dp[j] += next_dp[j-1]; next_dp[j] %= MOD; } dp = next_dp; } println!("{}", dp[k-n]); }