static int solve(int budget, int dish, int amount) {
		if (dish == k)
			return 0;

		if (dp[budget][dish][amount] != -1)
			return dp[budget][dish][amount];

		int best = 0, tax = 0, spent = (n * (x - t)) - budget, remain;

		// Two
		tax = (int) Math.ceil((spent + c[dish] * 2 + t * n) * 0.1);
		remain = budget - c[dish] * 2;
		if ((remain - tax) >= 0 && (amount + 2) <= n * 2)
			best = Math.max(best, f[dish] * 2 + solve(remain, dish + 1, amount + 2));

		// One
		tax = (int) Math.ceil((spent + c[dish] + t * n) * 0.1);
		remain = budget - c[dish];
		if ((remain - tax) >= 0 && (amount + 1) <= n * 2)
			best = Math.max(best, f[dish] + solve(remain, dish + 1, amount + 1));

		// Zero
		best = Math.max(best, solve(budget, dish + 1, amount));
		return dp[budget][dish][amount] = best;
	}