#include <bits/stdc++.h>
#define endl '\n'
#define int long long
using namespace std;
void solve(int x) {
for (int i = 2;i <= x / i;i++)
{
if (x % i == 0) {
int cnt = 0;
while (x % i == 0) {
x /= i;cnt++;
}
cout << i << ' ' << cnt << endl;
}
}
if (x > 1) cout << x << ' ' << 1 << endl;
}
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int tt;cin >> tt;
while (tt--) {
int num;
cin >> num;
solve(num);
}
}
ACM数学常识-质因式分解
于 2022-10-25 10:29:39 首次发布