#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  for (int t = 0; t < T; ++t) {
    int n;
    cin >> n;
    vector<int> v = {0};
    int i = 0;
    while (i < n) {
      i = n / (n / (i + 1));
      v.push_back(i);
    }
    int k = v.size();
    cout << k << '\n';
    for (int i = 0; i < k; ++i) {
      cout << v[i] << ((i < k - 1) ? ' ' : '\n');
    }
  }
  return 0;
}
