description: You are given a strictly convex polygon with n vertices.
  
  You will make k cuts that meet the following conditions: 
  
    * each cut is a segment that connects two different nonadjacent vertices; 
    * two cuts can intersect only at vertices of the polygon. 
  
  
  
  Your task is to maximize the area of the smallest region that will be formed by the polygon and those k cuts.
  
  Input
  
  The first line contains two integers n, k (3 ≤ n ≤ 200, 0 ≤ k ≤ n-3).
  
  The following n lines describe vertices of the polygon in anticlockwise direction. The i-th line contains two integers x_i, y_i (|x_i|, |y_i| ≤ 10^8) — the coordinates of the i-th vertex.
  
  It is guaranteed that the polygon is convex and that no two adjacent sides are parallel.
  
  Output
  
  Print one integer: the maximum possible area of the smallest region after making k cuts multiplied by 2.
  
  Examples
  
  Input
  
  
  8 4
  -2 -4
  2 -2
  4 2
  1 5
  0 5
  -4 4
  -5 0
  -5 -1
  
  
  Output
  
  
  11
  
  
  Input
  
  
  6 3
  2 -2
  2 -1
  1 2
  0 2
  -2 1
  -1 0
  
  
  Output
  
  
  3
  
  Note
  
  In the first example, it's optimal to make cuts between the following pairs of vertices: 
  
    * (-2, -4) and (4, 2), 
    * (-2, -4) and (1, 5), 
    * (-5, -1) and (1, 5), 
    * (-5, 0) and (0, 5). 
  
  <image> Points (-5, -1), (1, 5), (0, 5), (-5, 0) determine the smallest region with double area of 11. 
  
  In the second example, it's optimal to make cuts between the following pairs of vertices: 
  
    * (2, -1) and (0, 2), 
    * (2, -1) and (1, 0), 
    * (-1, 0) and (0, 2). 
  
  <image> Points (2, -2), (2, -1), (-1, 0) determine one of the smallest regions with double area of 3. 
solution: #include <bits/stdc++.h>
  using namespace std;
  using ll = long long;
  struct pt {
    ll x, y;
    pt(ll x_ = 0, ll y_ = 0) : x(x_), y(y_) {}
    pt operator+(pt p) const { return pt(x + p.x, y + p.y); }
    pt operator-(pt p) const { return pt(x - p.x, y - p.y); }
    friend ll cross(pt a, pt b) { return a.x * b.y - a.y * b.x; }
    friend ll cross(pt a, pt b, pt o) { return cross(a - o, b - o); }
  };
  void solve() {
    int n, k;
    cin >> n >> k;
    vector<pt> p(n);
    for (auto &[x, y] : p) {
      cin >> x >> y;
    }
    vector<vector<ll>> area(n, vector<ll>(n));
    for (int i = 0; i < n; i++) {
      for (int d = 1; d <= n - 1; d++) {
        int j1 = (i + d - 1) % n, j2 = (i + d) % n;
        area[i][j2] = area[i][j1] + cross(p[i], p[j1], p[j2]);
      }
    }
    auto check = [&](ll t) -> bool {
      vector<vector<int>> dp(n, vector<int>(n, 0));
      vector<vector<int>> minl(n + 1, vector<int>(n, 1e9));
      for (int d = 2; d <= n - 1; d++) {
        for (int l = 0; l < n; l++) {
          int r = (l + d) % n;
          auto &cur = dp[l][r];
          const auto ar = area[l][r] - t;
          for (int dl = 1; dl < d; dl++) {
            int m = (l + dl) % n;
            ll arl = dp[l][m] == 0 ? 0 : area[l][m];
            ll arr = dp[m][r] == 0 ? 0 : area[m][r];
            cur = max(cur, dp[l][m] + dp[m][r] + (ar >= arl + arr));
            int le = minl[cur][m];
            if (le + dl < d && ar >= area[m][(m + le) % n]) cur++;
          }
          minl[cur][l] = min(minl[cur][l], d);
        }
      }
      for (int l = 0; l < n; l++) {
        for (int r = 0; r < n; r++) {
          if (dp[l][r] + dp[r][l] >= k + 1) return true;
        }
      }
      return false;
    };
    if (k == 0) {
      cout << area[0][n - 1] << '\n';
      return;
    }
    ll l = 0, r = 1LL << 62;
    while (l < r - 1) {
      ll m = l + (r - l) / 2;
      if (check(m)) {
        l = m;
      } else {
        r = m;
      }
    }
    cout << l << '\n';
  }
  int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    int owo = 1;
    while (owo--) solve();
  }
  