#include<bits/stdc++.h>
using namespace std;
vector<int> get_divisors(int x)
{
vector<int> res;
for(int i = 1; i <= x / i; i ++)
if(x % i == 0)
{
res.push_back(i);
if(i != x / i) res.push_back(x / i);
}
sort(res.begin(), res.end());
return res;
}
int main()
{
int n;
cin >> n;
while(n --)
{
int x;
cin >> x;
auto res = get_divisors(x);
for(auto x : res) cout << x << ' ';
cout << endl;
}
return 0;
}
转载请注明原文地址:https://blackberry.8miu.com/read-4297.html