#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, ans = 0;
    cin >> n;
    vector<int> vec;
    vec.push_back(0);
    for (int l = 1, r; l <= n; l = r + 1) {
      r = n / (n / l);
      vec.push_back((n / l));
    }
    sort(vec.begin(), vec.end());
    cout << vec.size() << '\n';
    for (int i = 0; i < vec.size(); i++) cout << vec[i] << ' ';
    cout << '\n';
  }
}
