#include using namespace std; #define int long long templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> p >> q; double l, r; l = 1; r = 1e18; int cnt = 0; while(r-l > 1e-6){ double mid = (r+l)/2; if(isOK(mid)) l = mid; else r = mid; cnt++; if(cnt == 1000){ break; } } cout << cnt << endl; printf("%.12lf\n", l); return 0; }