Advertisement
Farjana_akter

Untitled

Jan 8th, 2020
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4.  
  5. int main()
  6. {
  7. int n,i,j,k,t,cas,ans,day,day1;
  8. double a,b,c,d,e;
  9. cin>>t;
  10. for(cas=1; cas<=t; cas++)
  11. {
  12. cin>>day;
  13. day1=day;
  14. int manus=0;
  15. double probability=1.0,gun=1.0;
  16. for(i=1;i<=day;i++)
  17. {
  18. probability*=(1.0*(day-i)/day);
  19. if(probability<=0.5)
  20. break;
  21. else
  22. manus++;
  23. }
  24. cout<<"Case "<<cas<<": "<<manus+1<<endl;
  25. }
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement