#include #include #include using namespace std; using namespace boost::multiprecision; typedef cpp_int Bint; typedef long long int llint; typedef long double real_t; Bint sqrt_floor(Bint x) { Bint ceil = x, floor = 1; while (ceil > floor + 1) { auto m = (ceil+floor)/2; if (m*m <= x) floor = m; else ceil = m; } return floor; } int main() { Bint unit = pow(Bint(10),20); cout << fixed << setprecision(17); int N; cin >> N; Bint ans = 0; for (auto i=0; i> x; auto p = sqrt_floor(x); if (p*p == x) { ans += p*unit; } else { Bint R = 1; Bint U = 1, V = p; Bint a = 2*p, b = x-p*p; while (R < unit) { R *= 2*p; auto prev_V = V; V = a*V + b*U; U = prev_V; } ans -= p * unit; ans += (V * unit)/U; } cout << real_t(ans)/real_t(unit) << endl; } return 0; }