diff --git a/AcWing/869/869.cpp b/AcWing/869/869.cpp new file mode 100644 index 00000000..ab96f2b3 --- /dev/null +++ b/AcWing/869/869.cpp @@ -0,0 +1,24 @@ +#include + +using namespace std; + +int n, a; + +int main() { + cin >> n; + while (n--) { + set 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; +}