diff --git a/AcWing/867/867.cpp b/AcWing/867/867.cpp new file mode 100644 index 00000000..6f73073a --- /dev/null +++ b/AcWing/867/867.cpp @@ -0,0 +1,27 @@ +#include + +using namespace std; + +int n, a; + +int main() { + cin >> n; + while (n--) { + cin >> a; + for (int i = 2; i * i <= a; i++) { + if (a % i == 0) { + int s = 0; + while (a % i == 0) { + a /= i; + s++; + } + cout << i << ' ' << s << endl; + } + } + if (a > 1) { + cout << a << ' ' << 1 << endl; + } + cout << endl; + } + return 0; +}