#include #include #include #include using namespace std; #include int main() { long long N; cin >> N; constexpr int L = 1010101; vector invsum(L + 1); for (int i = 0; i < L; ++i) invsum.at(i + 1) = invsum.at(i) + 1.0 / (i + 1); auto get_invsum = [&](long long n) -> double { if (n <= L) return invsum.at(n); return log(n) + std::numbers::egamma; }; double ret = get_invsum(N) * 2 - 1; long long d = 2; while (d <= N) { long long k = N / d; if (k <= 0) break; long long r = N / k; ret += (get_invsum(k) - 1) * (get_invsum(r) - get_invsum(d - 1)); d = r + 1; } cout << fixed << setprecision(13) << ret << '\n'; }