package leetcode;

/**
 * https://leetcode.com/problems/soup-servings/
 */
public class Problem808 {
    public double soupServings(int N) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem808 prob = new Problem808();
        System.out.println(prob.soupServings(50)); // 0.625
    }
}

@@ -165,17 +165,474 @@
  return 
-0
+soupServings(N, N);%0A    %7D%0A%0A    private double soupServings(int a, int b) %7B%0A        if (a %3C= 0 && b %3C= 0) %7B%0A            return 0.5;%0A        %7D%0A        if (a %3C= 0) %7B%0A            return 0;%0A        %7D%0A        if (b %3C= 0) %7B%0A            return 1;%0A        %7D%0A        double result = 0.25 * (soupServings(a, b - 100) +%0A            soupServings(a - 25, b - 75) +%0A            soupServings(a - 50, b - 50) +%0A            soupServings(a - 75, b - 25));%0A        return result
 ;%0A    %7D%0A
@@ -781,16 +781,139 @@
 / 0.625%0A
+        System.out.println(prob.soupServings(40)); // 0.625%0A        System.out.println(prob.soupServings(100)); // 0.71875%0A
     %7D%0A%7D%0A

Update problem 808