题目链接
https://www.luogu.org/problem/P4718
分析
玄学做法,难以描述,建议参考题解:
https://www.luogu.org/problemnew/solution/P4718
AC代码
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <cmath>
using namespace std;
typedef long long ll;
inline ll read() {
ll num = 0;
char c = getchar();
while (c < '0' || c > '9') c = getchar();
while (c >= '0' && c <= '9')
num = num * 10 + c - '0', c = getchar();
return num;
}
const int prime[11] = {
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31};
inline ll qmul(ll a, ll b,