ll prime[100]; ll cnt; void getprime(){ cnt = 0; ll num = m; for(ll i = 2; i*i <= m; i++){ // sqrt(m) 的复杂度求出m的素因子 if (num%i == 0) { prime[cnt++] = i; while(num%i == 0){ num /= i; } } if (num == 1) break; } if (num > 1) prime[cnt++] = num; } void solve() { ll ans = 0; // cnt 下标从0开始 for(ll i = 1; i < (1<<cnt); i++){ ll f = 0; ll tem = 1; for(ll j = 0; j < cnt; j++){ if (i&(1<<j)) { f++; tem *= prime[j]; } } ll time = n/tem; // 奇加偶减 if (f&1) ans = (ans+cal1(tem, time)+cal2(tem, time))%mod; else ans = (ans-cal1(tem, time)-cal2(tem, time))%mod; ans = (ans+mod)%mod; } ll sum = (cal1(1, n)+cal2(1, n))%mod; ans = (sum-ans)%mod; printf("%lld ", (ans+mod)%mod); }