mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-05 08:18:47 +00:00
25 lines
419 B
C++
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;
|
||
|
}
|