![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 #include <bits/stdc++.h> 2 #define exp 0.00001 3 using namespace std; 4 typedef long long ll; 5 6 double solve(double x, double y) 7 { 8 return 42* pow(x, 6) + 48*pow(x, 5) + 21*x*x+ 10*x - y; 9 } 10 int main() 11 { 12 double y; 13 int t; 14 cin >> t; 15 while(t--) 16 { 17 cin >> y; 18 double l = 0, r = 100, x0; 19 while(l - r <= exp) 20 { 21 double mid = (l + r)/2; 22 if(solve(mid, y) >= 1e-9) r = mid - exp, x0 = mid; 23 else l = mid + exp; 24 } 25 cout << fixed << setprecision(4) << 6*pow(x0, 7)+ 8*pow(x0, 6)+ 7*x0*x0*x0 + 5*x0*x0 - y*x0 + 1e-9 << endl; 26 27 } 28 return 0; 29 }