Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define int long long
- #define mp make_pair
- #define pb push_back
- const long double eps = 1e-7;
- signed main() {
- ios::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);
- //freopen("input.txt","r",stdin);
- //freopen("output.txt","w",stdout);
- long double C;
- cin >> C;
- long double L = 0,R = (int)1e9;
- long double mid;
- while(R-L>eps)
- {
- mid = (L+R)/2;
- if(mid*mid + sqrt(mid) > C)
- R = mid;
- else
- L = mid;
- }
- cout << fixed << setprecision(8) << (L+R)/2;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement