Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define suni ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
- #define endl "\n"
- #define mn int main()
- #define frac() cout.unsetf(ios::floatfield);cout.precision(6);cout.setf(ios::fixed,ios::floatfield);
- typedef long long ll;
- mn
- {
- suni;
- int t; cin>>t;
- for(int i=1;i<=t;i++){
- double L,n,c;
- cin>>L>>n>>c;
- double L1=(1+(n*c))*L;
- double l=0,r=1e18;
- for(int j=1;j<=100;j++){
- double R=(l+r)/2.0;
- double ans=R*2*asin(L/(2.0*R));
- if(ans>L1) l=R;
- else r=R;
- }
- double R=l;
- double h=R-sqrt((R*R)-(L/2.0)*(L/2.0));
- frac();
- cout<<"Case "<<i<<": "<<h<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement