#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main() {
  int t;
  cin >> t;
  for (int test = 0; test < t; test++) {
    int n;
    cin >> n;
    set<int> answer;
    int r = pow(n, 0.5);
    for (int i = 0; i <= r; i++) {
      answer.insert(i);
    }
    for (int i = r; i >= 1; i--) {
      answer.insert(n / i);
    }
    cout << answer.size() << "\n";
    for (auto i = answer.begin(); i != answer.end(); i++) cout << *i << " ";
    cout << "\n";
  }
}
