Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int ans;
- long double r,h,w;
- void rec (long double a, long double b, int step)
- {
- if ((4 * r * r) - (a * a + b * b) >= 0)
- {
- //cout << 4 * r * r << " " << a * a + b * b << endl;
- ans = min(ans, step);
- return;
- }
- rec(a / 2, b, step + 1);
- rec(a, b / 2, step + 1);
- }
- int main()
- {
- // freopen("input.txt", "r", stdin);
- //freopen("output.txt", "w", stdout);
- ios_base::sync_with_stdio(false);
- cin.tie(0);
- cout.tie(0);
- //cout << fixed << setprecision(20);
- cin >> r >> h >> w;
- ans = 1e9;
- rec(h, w, 0);
- cout << ans;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement