double bsearch_3(double l,double r ) { const double eps = 1e-8; while(r-l>eps) { double mid = (l+r) / 2; if(check(mid)) r = mid; else l = mid; } return l; }