/* -*- coding: utf-8 -*- * * 1042.cc: No.1042 愚直大学 - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const double MAX_N = 1e10; const int CNT = 1000; /* typedef */ /* global variables */ /* subroutines */ /* main */ int main() { int p, q; scanf("%d%d", &p, &q); double n0 = 1.0, n1 = MAX_N; for (int cnt = 0; cnt < CNT; cnt++) { double n = (n0 + n1) / 2; if (n * n > p + q * n * log2(n)) n1 = n; else n0 = n; } printf("%.9lf\n", n0); return 0; }