This documentation is automatically generated by online-judge-tools/verification-helper
#include "setfunc/or_convolution.hpp"
#include "setfunc/zeta.hpp"
template <typename T>
vc<T> or_convolution(vc<T> A, vc<T> B) {
subset_zeta(A);
subset_zeta(B);
FOR(i, len(A)) A[i] *= B[i];
subset_mobius(A);
return A;
}
#line 2 "setfunc/zeta.hpp"
template <typename T>
void superset_zeta(vc<T>& a) {
int n = len(a);
for (int i = 1; i != n; i <<= 1)
for (int j = 0; j != n; j += i << 1)
for (int k = 0; k != i; k++) a[j + k] += a[i + j + k];
}
template <typename T>
void superset_mobius(vc<T>& a) {
int n = len(a);
for (int i = 1; i != n; i <<= 1)
for (int j = 0; j != n; j += i << 1)
for (int k = 0; k != i; k++) a[j + k] -= a[i + j + k];
}
template <typename T>
void subset_zeta(vc<T>& a) {
int n = len(a);
for (int i = 1; i != n; i <<= 1)
for (int j = 0; j != n; j += i << 1)
for (int k = 0; k != i; k++) a[i + j + k] += a[j + k];
}
template <typename T>
void subset_mobius(vc<T>& a) {
int n = len(a);
for (int i = 1; i != n; i <<= 1)
for (int j = 0; j != n; j += i << 1)
for (int k = 0; k != i; k++) a[i + j + k] -= a[j + k];
}
#line 2 "setfunc/or_convolution.hpp"
template <typename T>
vc<T> or_convolution(vc<T> A, vc<T> B) {
subset_zeta(A);
subset_zeta(B);
FOR(i, len(A)) A[i] *= B[i];
subset_mobius(A);
return A;
}