#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int LIM = 100005;
const int P = 1e9 + 7;
ll f[LIM], g[LIM], h[LIM];
ll fh[LIM], gh[LIM], hh[LIM];
void ztf(ll a[], ll ah[], int lim) {
for (int i = 0; i <= lim; ++i) ah[i] = 0;
for (int i = 1; i <= lim; ++i) {
for (int j = i; j <= lim; j += i) {
ah[i] = (ah[i] + a[j]) % P;
}
}
}
void itf(ll ah[], int lim) {
for (int i = lim; i >= 1; --i) {
for (int j = 2 * i; j <= lim; j += i) {
ah[i] = (ah[i] - ah[j] + P) % P;
}
}
}
void gcv(int n0) {
ztf(f, fh, n0);
ztf(g, gh, n0);
for (int i = 1; i <= n0; ++i) {
hh[i] = fh[i] * gh[i] % P;
}
itf(hh, n0);
for(int i = 1; i <= n0; ++i) h[i] = hh[i];
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n0_ex; cin >> n0_ex;
for (int i = 1; i <= n0_ex; ++i) {
cin >> f[i];
}
for (int i = 1; i <= n0_ex; ++i) {
cin >> g[i];
}
gcv(n0_ex);
for (int k = 1; k <= n0_ex; ++k) {
cout << h[k] << " ";
}
return 0;
}剪贴板
剪贴板 skxxcha9
剪贴板信息
剪贴板信息
- 收录
- 更新