#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5;
struct item {
  int mx, pos;
};
struct segtree {
  int size;
  vector<item> values;
  item NEUTRAL_ELEMENT = {INT_MIN, -1};
  void init(int n) {
    size = 1;
    while (size < n) size *= 2;
    values.resize(2 * size - 1);
  }
  item merge(item a, item b) {
    if (a.mx > b.mx) return a;
    return b;
  }
  item single(int v, int pos) { return {v, pos}; }
  void build(vector<int>& a, int x, int lx, int rx) {
    if (lx == rx) {
      if (lx < a.size()) values[x] = single(a[lx], lx);
      return;
    }
    int m = lx + (rx - lx) / 2;
    build(a, 2 * x + 1, lx, m);
    build(a, 2 * x + 2, m + 1, rx);
    values[x] = merge(values[2 * x + 1], values[2 * x + 2]);
  }
  void build(vector<int>& a) { build(a, 0, 0, size - 1); }
  void set(int i, int v, int x, int lx, int rx) {
    if (lx == rx) {
      values[x] = single(v, lx);
      return;
    }
    int m = lx + (rx - lx) / 2;
    if (i <= m)
      set(i, v, 2 * x + 1, lx, m);
    else
      set(i, v, 2 * x + 2, m + 1, rx);
    values[x] = merge(values[2 * x + 1], values[2 * x + 2]);
  }
  void set(int i, int v) { set(i, v, 0, 0, size - 1); }
  item calc(int l, int r, int x, int lx, int rx) {
    if (lx > r || rx < l) return NEUTRAL_ELEMENT;
    if (lx >= l && rx <= r) return values[x];
    int m = lx + (rx - lx) / 2;
    item res1 = calc(l, r, 2 * x + 1, lx, m);
    item res2 = calc(l, r, 2 * x + 2, m + 1, rx);
    return merge(res1, res2);
  }
  item calc(int l, int r) { return calc(l, r, 0, 0, size - 1); }
};
struct BIT {
  vector<long long> values;
  int size;
  void init(int n) {
    size = n + 1;
    values.resize(n + 1, 0);
  }
  void update(int idx, int val) {
    while (idx <= size) {
      values[idx] += val;
      idx += idx & -idx;
    }
  }
  long long sum(int idx) {
    long long sum = 0;
    while (idx > 0) {
      sum += values[idx];
      idx -= idx & -idx;
    }
    return sum;
  }
  long long rangeSum(int i, int j) { return sum(j) - sum(i - 1); }
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  vector<tuple<int, int, int>> a(n);
  BIT bt;
  bt.init(MAX + 2);
  for (int i = 0; i < n; i++) {
    int l, r;
    cin >> l >> r;
    l--, r--;
    a[i] = make_tuple(l, r, i);
    bt.update(l + 1, 1);
    bt.update(r + 2, -1);
  }
  sort(a.begin(), a.end());
  vector<int> b(n);
  for (int i = 0; i < n; i++) b[i] = get<1>(a[i]);
  segtree st;
  st.init(n);
  st.build(b);
  vector<int> ans;
  for (int i = 0; i <= MAX; i++) {
    int cur = bt.sum(i + 1);
    int idx =
        upper_bound(a.begin(), a.end(), make_tuple(i, INT_MAX, 0)) - a.begin();
    while (cur > k) {
      auto res = st.calc(0, idx - 1);
      st.set(res.pos, INT_MIN);
      ans.push_back(get<2>(a[res.pos]) + 1);
      bt.update(i + 1, -1);
      bt.update(res.mx + 2, 1);
      cur--;
    }
  }
  cout << ans.size() << '\n';
  for (int x : ans) cout << x << ' ';
}

### Prompt

Your challenge is to write a CPP solution to the following problem:

The only difference between easy and hard versions is constraints.

You are given n segments on the coordinate axis OX. Segments can intersect, lie inside each other and even coincide. The i-th segment is [l_i; r_i] (l_i ≤ r_i) and it covers all integer points j such that l_i ≤ j ≤ r_i.

The integer point is called bad if it is covered by strictly more than k segments.

Your task is to remove the minimum number of segments so that there are no bad points at all.

Input

The first line of the input contains two integers n and k (1 ≤ k ≤ n ≤ 200) — the number of segments and the maximum number of segments by which each integer point can be covered.

The next n lines contain segments. The i-th line contains two integers l_i and r_i (1 ≤ l_i ≤ r_i ≤ 200) — the endpoints of the i-th segment.

Output

In the first line print one integer m (0 ≤ m ≤ n) — the minimum number of segments you need to remove so that there are no bad points.

In the second line print m distinct integers p_1, p_2, ..., p_m (1 ≤ p_i ≤ n) — indices of segments you remove in any order. If there are multiple answers, you can print any of them.

Examples

Input


7 2
11 11
9 11
7 8
8 9
7 8
9 11
7 9


Output


3
1 4 7 


Input


5 1
29 30
30 30
29 29
28 30
30 30


Output


3
1 2 4 


Input


6 1
2 3
3 3
2 3
2 2
2 3
2 3


Output


4
1 3 5 6 

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5;
struct item {
  int mx, pos;
};
struct segtree {
  int size;
  vector<item> values;
  item NEUTRAL_ELEMENT = {INT_MIN, -1};
  void init(int n) {
    size = 1;
    while (size < n) size *= 2;
    values.resize(2 * size - 1);
  }
  item merge(item a, item b) {
    if (a.mx > b.mx) return a;
    return b;
  }
  item single(int v, int pos) { return {v, pos}; }
  void build(vector<int>& a, int x, int lx, int rx) {
    if (lx == rx) {
      if (lx < a.size()) values[x] = single(a[lx], lx);
      return;
    }
    int m = lx + (rx - lx) / 2;
    build(a, 2 * x + 1, lx, m);
    build(a, 2 * x + 2, m + 1, rx);
    values[x] = merge(values[2 * x + 1], values[2 * x + 2]);
  }
  void build(vector<int>& a) { build(a, 0, 0, size - 1); }
  void set(int i, int v, int x, int lx, int rx) {
    if (lx == rx) {
      values[x] = single(v, lx);
      return;
    }
    int m = lx + (rx - lx) / 2;
    if (i <= m)
      set(i, v, 2 * x + 1, lx, m);
    else
      set(i, v, 2 * x + 2, m + 1, rx);
    values[x] = merge(values[2 * x + 1], values[2 * x + 2]);
  }
  void set(int i, int v) { set(i, v, 0, 0, size - 1); }
  item calc(int l, int r, int x, int lx, int rx) {
    if (lx > r || rx < l) return NEUTRAL_ELEMENT;
    if (lx >= l && rx <= r) return values[x];
    int m = lx + (rx - lx) / 2;
    item res1 = calc(l, r, 2 * x + 1, lx, m);
    item res2 = calc(l, r, 2 * x + 2, m + 1, rx);
    return merge(res1, res2);
  }
  item calc(int l, int r) { return calc(l, r, 0, 0, size - 1); }
};
struct BIT {
  vector<long long> values;
  int size;
  void init(int n) {
    size = n + 1;
    values.resize(n + 1, 0);
  }
  void update(int idx, int val) {
    while (idx <= size) {
      values[idx] += val;
      idx += idx & -idx;
    }
  }
  long long sum(int idx) {
    long long sum = 0;
    while (idx > 0) {
      sum += values[idx];
      idx -= idx & -idx;
    }
    return sum;
  }
  long long rangeSum(int i, int j) { return sum(j) - sum(i - 1); }
};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  vector<tuple<int, int, int>> a(n);
  BIT bt;
  bt.init(MAX + 2);
  for (int i = 0; i < n; i++) {
    int l, r;
    cin >> l >> r;
    l--, r--;
    a[i] = make_tuple(l, r, i);
    bt.update(l + 1, 1);
    bt.update(r + 2, -1);
  }
  sort(a.begin(), a.end());
  vector<int> b(n);
  for (int i = 0; i < n; i++) b[i] = get<1>(a[i]);
  segtree st;
  st.init(n);
  st.build(b);
  vector<int> ans;
  for (int i = 0; i <= MAX; i++) {
    int cur = bt.sum(i + 1);
    int idx =
        upper_bound(a.begin(), a.end(), make_tuple(i, INT_MAX, 0)) - a.begin();
    while (cur > k) {
      auto res = st.calc(0, idx - 1);
      st.set(res.pos, INT_MIN);
      ans.push_back(get<2>(a[res.pos]) + 1);
      bt.update(i + 1, -1);
      bt.update(res.mx + 2, 1);
      cur--;
    }
  }
  cout << ans.size() << '\n';
  for (int x : ans) cout << x << ' ';
}

```