#include <bits/stdc++.h>
using namespace std;
int main() {
  static int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int n;
    cin >> n;
    int sqrn = (int)(sqrt(n));
    int ans = 2 * sqrn + 1;
    if ((int)(n / sqrn) == sqrn) ans--;
    cout << ans << '\n';
    for (int x = 0; x <= sqrn; x++) cout << x << ' ';
    if (ans % 2) cout << (int)(n / sqrn) << ' ';
    for (int x = sqrn - 1; x > 0; x--) cout << (int)(n / x) << ' ';
    cout << '\n';
  }
}
