mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-24 12:48:49 +00:00
28 lines
519 B
C++
28 lines
519 B
C++
|
#include <bits/stdc++.h>
|
||
|
|
||
|
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;
|
||
|
}
|