public boolean firstWillWin(int[] values) {
        // write your code here
        int n = values.length;
        // dp[i][j] means the value can get from i to j
        // dp[i][j] = max(v[i] + min(dp[i+2][j],dp[i+3][j]),
        //                v[i] + v[i+1] + min(dp[i+3][j], dp[i+4][j]))
        int sum = 0;
        for (int i : values)
            sum += i;
        int[][] dp = new int[n][n];
        for (int gap = 0; gap < n; ++gap) {
            for (int i = 0, j = gap; j < n; ++i, ++j) {
                System.out.println(i + " -> " + j);
                int x = (i + 2) <= j ? dp[i + 2][j] : 0;
                int y = (i + 3) <= j ? dp[i + 3][j] : 0;
                int z = (i + 4) <= j ? dp[i + 4][j] : 0;
                int w = (i + 1) <= j ? values[i + 1] : 0;
                dp[i][j] = Math.max(values[i] + Math.min(x, y), values[i] + w + Math.min(y, z));
                print(dp);
            }
        }
        return dp[0][n - 1] * 2 > sum;
    }