#include <bits/stdc++.h>
using namespace std;
int q = 1;
int n;
void solve() {
  set<int> s;
  cin >> n;
  s.insert(0);
  for (int i = 1; i * i <= n; i++) {
    int u = n / i;
    s.insert(u);
    s.insert(n / u);
  }
  cout << (int)s.size() << endl;
  for (auto x : s) cout << x << " ";
  cout << endl;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin >> q;
  while (q--) {
    solve();
  }
}
