Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define test int tt; cin>>tt; for(int cs=1;cs<=tt;cs++)
- int main()
- {
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- test
- {
- double L,n,C,s,L1;
- cin>>L>>n>>C;
- L1 = (1 + n * C) * L;
- double lo=0.0,hi=L/2.00,mid,r,theta;
- while(hi-lo>(1e-9))
- {
- mid=(lo+hi)/2;
- r=(mid/2.00)+(L*L)/(8.00*mid);
- theta= 2.0*asin((L/2.00)/r);
- s=r*theta;
- if(s>=L1)
- {
- hi=mid;
- }
- else lo=mid;
- }
- cout<<"Case "<<cs<<": "<<fixed<<setprecision(10)<<lo<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement