static long solve(int l, int prev, int acum) {
		if (l == k)
			return 1L;
		if ((s - acum) > (k - l) * n)
			return 0L;
		if (dp[l][prev][acum] != -1L)
			return dp[l][prev][acum];
		long ans = 0;
		int min = Math.min(n, s - acum - (k - l - 1) * n);
		min = Math.max(min, prev + 1);
		int max = Math.max(0, (s - acum) - (k - l - 1));
		max = Math.min(max, n);
		for (int i = min; i <= max; i++)
			ans += solve(l + 1, i, acum + i);
		return dp[l][prev][acum] = ans;
	}