#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int m;
    cin >> m;
    vector<vector<int> > a;
    for (int j = 0; j < 2 * m - 1; j++) {
      int u, v;
      cin >> u >> v;
      vector<int> b;
      b.push_back(u);
      b.push_back(v);
      b.push_back(j);
      a.push_back(b);
    }
    sort(a.begin(), a.end());
    vector<int> ans;
    ans.push_back(a[2 * m - 2][2] + 1);
    for (int j = 0; j < 2 * m - 2; j += 2) {
      if (a[j][1] >= a[j + 1][1]) ans.push_back(a[j][2] + 1);
      if (a[j][1] < a[j + 1][1]) ans.push_back(a[j + 1][2] + 1);
    }
    sort(ans.begin(), ans.end());
    cout << "YES" << endl;
    for (int j = 0; j < ans.size(); j++) cout << ans[j] << " ";
    cout << endl;
  }
}
