#include <bits/stdc++.h>
using namespace std;
const int INF = 1000 * 1000 * 1000;
const long long LINF = INF * (long long)INF;
const int mod = 1000 * 1000 * 1000 + 7;
const int MAX = 300005;
const int LG = 20;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> ans;
    ans.push_back(0);
    for (int i = 1; i <= 32000; i++) {
      ans.push_back(n / i);
      if (i * i <= n) ans.push_back(i);
    }
    sort(ans.begin(), ans.end());
    ans.resize(unique(ans.begin(), ans.end()) - ans.begin());
    cout << (int)(ans.size()) << endl;
    for (auto first : ans) cout << first << " ";
    cout << endl;
  }
}
