Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n,i,j,k,t,cas,ans,day,day1;
- double a,b,c,d,e;
- cin>>t;
- for(cas=1; cas<=t; cas++)
- {
- cin>>day;
- day1=day;
- int manus=0;
- double probability=1.0,gun=1.0;
- for(i=1;i<=day;i++)
- {
- probability*=(1.0*(day-i)/day);
- if(probability<=0.5)
- break;
- else
- manus++;
- }
- cout<<"Case "<<cas<<": "<<manus+1<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement