#include <bits/stdc++.h>
using namespace std;
const long long maxn = 110;
const long long inf = 0x3f3f3f3f;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    cout << n - 1 << endl;
    for (long long i = 1; i <= n - 1; i++) {
      cout << i + 1 << " ";
    }
    cout << endl;
  }
  return 0;
}
