// Compile: g++ -std=c++20 -O2 -Wall -I$HOME/ctf/tools/ac-library -DLOCAL -o sol sol.cpp // Or: make sol (uses Makefile in this dir) // Run: ./sol < in.txt #include #include using namespace std; using namespace atcoder; using ll = long long; using ull = unsigned long long; using vi = vector; using vll = vector; using vvi = vector; using vvll = vector; using pii = pair; using pll = pair; #define rep(i,n) for(ll i=0;i<(ll)(n);++i) #define rep2(i,a,b) for(ll i=(ll)(a);i<(ll)(b);++i) #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() #define sz(x) ((ll)(x).size()) template bool chmin(T&a,const T&b){if(b bool chmax(T&a,const T&b){if(a1 for (ll k = 2; (ll)(pow((long double)n, (long double)1.0/(long double)k)) > 1; k++) { ans += ((ll)floor(pow((long double)n, (long double)1.0 / (long double)k))-1) * p_sum; // cout << "k=" << k << ": "<< ans.val() << endl; } mint k2_sub = 0; for (ll q = 1; (ll)(pow((long double)n, (long double)1.0 / (long double)2.0)) >= q + 1; q++) { k2_sub += (mint)q * (q + 2) * (q + 1) * (q + 1) / 2; // cout << "q=" << q << ": "< store(n+1); // for (ll i = 1; i <= n; i++) { // mint now = 1; // cout << "i=" << i << ", valid_k= "; // for (ll k = 1; k <= 20000; k++) { // now *= (ll)(pow((long double)i, (long double)1.0/(long double)k)); // if((ll)(pow(i, 1.0/k))>1) cout << k << ", "; // } // cout << " -> now=" << now.val(); // ans += now; // store[i] = now.val(); // cout << ", diff=" << store[i] - store[i - 1] << endl; // } cout << ans.val() << endl; return 0; }