参考官方题解写的
/* Pigonometry */
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long LL;
int cnt[5];
LL A, B, lb, ub, ans, dp[20][33][20][14][12], dec[20];
int fact[] = {2, 3, 5, 7};
int code[11][4] = {
{0, 0, 0, 0},
{0, 0, 0, 0},
{1, 0, 0, 0},
{0, 1, 0, 0},
{2, 0, 0, 0},
{0, 0, 1, 0},
{1, 1, 0, 0},
{0, 0, 0, 1},
{3, 0, 0, 0},
{0, 2, 0, 0}
};
inline LL ceil(LL a, LL b) {
return (a + b - 1) / b;
}
inline LL floor(LL a, LL b) {
return a / b;
}
inline LL dfs(int x, LL pref) {
LL b = pref + dec[x] - 1;
if(pref > ub || b < lb) return 0;
if(x ==