#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    set<int> s;
    int n, x;
    cin >> n;
    for (x = 0; x * x <= n; x++) s.insert(x);
    for (int d = 1; d <= x; d++) s.insert(n / d);
    cout << s.size() << '\n';
    for (int k : s) cout << k << " ";
    cout << '\n';
  }
}
