#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using Int = long long; template ostream &operator<<(ostream &os, const pair &a) { return os << "(" << a.first << ", " << a.second << ")"; }; template ostream &operator<<(ostream &os, const vector &as) { const int sz = as.size(); os << "["; for (int i = 0; i < sz; ++i) { if (i >= 256) { os << ", ..."; break; } if (i > 0) { os << ", "; } os << as[i]; } return os << "]"; } template void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; } template bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; } template bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; } #define COLOR(s) ("\x1b[" s "m") using Double = long double; constexpr int LIM = 1'000'005; Double small[LIM]; Double har(Int n) { if (n < LIM) return small[n]; return log((Double)n) + 0.57721566490153286061L + 1.L/2/n - 1.L/12/n/n + 1.L/120/n/n/n/n; } int main() { for (int i = 1; i < LIM; ++i) { small[i] = small[i - 1] + 1.L / i; } Int N; for (; ~scanf("%lld", &N); ) { Double ans = 0.0; for (Int a = 0, b = N; a < N; a = b) { const Int k = N / (a + 1); b = N / k; // (a, b]: k ans += (har(b) - har(a)) * har(k); } printf("%.12Lf\n", ans); } return 0; }