import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.Scanner; import java.util.Set; public class Main { public static final long MOD = 1000000007; public static long dfs(final int N, final int rest, final int K, final int prev, ArrayList>> memoized){ final int use_limit = prev + K; if(memoized.get(N).containsKey(rest) && memoized.get(N).get(rest).containsKey(prev)){ return memoized.get(N).get(rest).get(prev); } if(N == 0){ return rest == 0 ? 1 : 0; } else if(rest <= 0){ return 0; } final int lowest = N * use_limit + N * (N - 1) / 2 * K; //System.out.println(lowest); if(lowest > rest){ if(!memoized.get(N).containsKey(rest)){ memoized.get(N).put(rest, new HashMap()); } memoized.get(N).get(rest).put(prev, 0l); return 0; } //System.out.println(N + " " + use_limit + " " + rest + " " + lowest + " " + (rest - lowest + N - 1) / N); long ret = 0; for(int use = use_limit + (rest - lowest + N - 1) / N; use >= use_limit; use--){ //System.out.println(use); ret += dfs(N - 1, rest - use, K, use, memoized); ret %= MOD; } if(!memoized.get(N).containsKey(rest)){ memoized.get(N).put(rest, new HashMap()); } memoized.get(N).get(rest).put(prev, ret); return ret; } public static void main(String[] args){ Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); final int S = sc.nextInt(); final int K = sc.nextInt(); ArrayList>> memoized = new ArrayList>>(); for(int i = 0; i <= N; i++){ memoized.add(new HashMap>()); } System.out.println(dfs(N, S, K, -K, memoized)); //System.out.println(memoized); } }