0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-18 12:51:58 +00:00
OI-codes/AcWing/869/869.cpp

25 lines
419 B
C++
Raw Normal View History

#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;
}