Problem: Polycarp plays a computer game. In this game, the players summon armies of magical minions, which then fight each other.

Polycarp can summon n different minions. The initial power level of the i-th minion is a_i, and when it is summoned, all previously summoned minions' power levels are increased by b_i. The minions can be summoned in any order.

Unfortunately, Polycarp cannot have more than k minions under his control. To get rid of unwanted minions after summoning them, he may destroy them. Each minion can be summoned (and destroyed) only once.

Polycarp's goal is to summon the strongest possible army. Formally, he wants to maximize the sum of power levels of all minions under his control (those which are summoned and not destroyed).

Help Polycarp to make up a plan of actions to summon the strongest possible army!

Input

The first line contains one integer T (1 ≤ T ≤ 75) — the number of test cases.

Each test case begins with a line containing two integers n and k (1 ≤ k ≤ n ≤ 75) — the number of minions availible for summoning, and the maximum number of minions that can be controlled by Polycarp, respectively.

Then n lines follow, the i-th line contains 2 integers a_i and b_i (1 ≤ a_i ≤ 10^5, 0 ≤ b_i ≤ 10^5) — the parameters of the i-th minion.

Output

For each test case print the optimal sequence of actions as follows:

Firstly, print m — the number of actions which Polycarp has to perform (0 ≤ m ≤ 2n). Then print m integers o_1, o_2, ..., o_m, where o_i denotes the i-th action as follows: if the i-th action is to summon the minion x, then o_i = x, and if the i-th action is to destroy the minion x, then o_i = -x. Each minion can be summoned at most once and cannot be destroyed before being summoned (and, obviously, cannot be destroyed more than once). The number of minions in Polycarp's army should be not greater than k after every action.

If there are multiple optimal sequences, print any of them.

Example

Input


3
5 2
5 3
7 0
5 0
4 0
10 0
2 1
10 100
50 10
5 5
1 5
2 4
3 3
4 2
5 1


Output


4
2 1 -1 5
1
2
5
5 4 3 2 1

Note

Consider the example test.

In the first test case, Polycarp can summon the minion 2 with power level 7, then summon the minion 1, which will increase the power level of the previous minion by 3, then destroy the minion 1, and finally, summon the minion 5. After this, Polycarp will have two minions with power levels of 10.

In the second test case, Polycarp can control only one minion, so he should choose the strongest of them and summon it.

In the third test case, Polycarp is able to summon and control all five minions.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <class T>
struct rge {
  T b, e;
};
template <class T>
rge<T> range(T i, T j) {
  return rge<T>{i, j};
}
struct debug {
  template <class T>
  debug& operator<<(const T&) {
    return *this;
  }
};
using ll = long long;
template <typename T>
void min_self(T& a, T b) {
  a = min(a, b);
}
template <typename T>
void max_self(T& a, T b) {
  a = max(a, b);
}
int k;
template <typename flow_t, typename cost_t>
class MinCostFlow {
 public:
  MinCostFlow(int _n, int _source, int _sink)
      : n(_n), source(_source), sink(_sink) {
    g.resize(n);
    cost.resize(n, vector<cost_t>(n));
    cap.resize(n, vector<flow_t>(n));
  }
  void add_edge(int from, int to, cost_t weight, flow_t c) {
    g[from].push_back(to);
    g[to].push_back(from);
    cost[to][from] = -weight;
    cost[from][to] = weight;
    cap[from][to] = c;
  }
  struct State {
    cost_t dist;
    int node;
    bool operator<(const State& rhs) const { return dist > rhs.dist; }
  };
  void shortest_paths(vector<cost_t>& dist, vector<int>& par) {
    dist.assign(n, COST_INF);
    par.assign(n, -1);
    dist[source] = 0;
    priority_queue<State> pq;
    pq.push({0LL, source});
    while (!pq.empty()) {
      State u = pq.top();
      pq.pop();
      if (u.dist > dist[u.node]) continue;
      for (int v : g[u.node]) {
        if (dist[v] > u.dist + cost[u.node][v] && cap[u.node][v] > 0) {
          dist[v] = u.dist + cost[u.node][v];
          par[v] = u.node;
          pq.push({dist[v], v});
        }
      }
    }
  }
  cost_t min_cost_flow() {
    flow_t mf = 0;
    cost_t total_cost = 0;
    vector<cost_t> dist(n);
    vector<int> par(n);
    while (true) {
      shortest_paths(dist, par);
      if (dist[sink] == COST_INF) {
        break;
      }
      flow_t f = FLOW_INF;
      int cur = sink;
      while (cur != source) {
        f = min(f, cap[par[cur]][cur]);
        cur = par[cur];
      }
      mf += f;
      total_cost += dist[sink];
      cur = sink;
      while (cur != source) {
        cap[par[cur]][cur] -= f;
        cap[cur][par[cur]] += f;
        cur = par[cur];
      }
    }
    int m = (sink - 1) / 2;
    cout << k + 2 * (m - k) << endl;
    for (int i = 0; i < int(m); i++) {
      int pos = i + m;
      for (int j = 0; j < int(m); j++) {
        if (cap[j][pos] == 0) {
          if (i < k - 1 || i == m - 1) {
            cout << j + 1 << ' ';
          } else {
            cout << (j + 1) << ' ' << -(j + 1) << ' ';
          }
        }
      }
    }
    cout << endl;
    return total_cost;
  }

 private:
  const flow_t FLOW_INF = numeric_limits<flow_t>::max() / 2;
  const cost_t COST_INF = numeric_limits<cost_t>::max() / 2;
  vector<vector<int>> g;
  vector<vector<flow_t>> cap;
  vector<vector<cost_t>> cost;
  int n, source, sink;
};
void test_case() {
  int n;
  cin >> n >> k;
  vector<int> a(n), b(n);
  for (int i = 0; i < int(n); i++) {
    cin >> a[i] >> b[i];
  }
  int source = 2 * n, sink = 2 * n + 1;
  MinCostFlow<int, int> graph(2 * n + 2, source, sink);
  for (int i = 0; i < n; i++) {
    graph.add_edge(source, i, 0, 1);
    graph.add_edge(i + n, sink, 0, 1);
  }
  for (int i = 0; i < n; i++) {
    for (int pos = 0; pos < n; pos++) {
      int w = 0;
      if (pos < k - 1) {
        w = -(a[i] + pos * b[i]);
      } else if (pos < n - 1) {
        w = -(k - 1) * b[i];
      } else {
        w = -(a[i] + (k - 1) * b[i]);
      }
      graph.add_edge(i, pos + n, w, 1);
    }
  }
  graph.min_cost_flow();
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int tc;
  cin >> tc;
  while (tc--) {
    test_case();
  }
}