0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-25 19:32:12 +00:00
OI-codes/AcWing/869/869.cpp

25 lines
419 B
C++

#include <bits/stdc++.h>
using namespace std;
int n, a;
int main() {
cin >> n;
while (n--) {
set<int> ans;
cin >> a;
for (int i = 1; i * i <= a; i++) {
if (a % i == 0) {
ans.insert(i);
ans.insert(a / i);
}
}
for (int i : ans) {
cout << i << ' ';
}
cout << endl;
}
return 0;
}