- /****************##### بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم #####*******************
- __________________________________________________________________________
- ###################### Ya-Seen Arafat(ACWizard) #########################
- ###################### UAP-CSE-33B #########################
- *************************************************************************/
- #include <bits/stdc++.h>
- #define sc(n) scanf("%d", &n)
- #define S 2003
- using namespace std;
- typedef long long LL;
- void Do(){
- int t, n, tmp, ans, cs = 0;
- double cn;
- cin >> t;
- while(t--){
- cin >> n;
- ans = 0; cn = 1.0;
- for(int i = n; ; i--){
- ans++;
- cn *= (i/(double)n);
- tmp = (1.0-cn)*1000000000;
- if(tmp >= 500000000)break;
- }
- cout << "Case " << ++cs << ": " << --ans << endl;
- }
- }
- int main(){
- //ios_base::sync_with_stdio(0); cin.tie(0);
- #ifndef ONLINE_JUDGE
- ///freopen("inp","r",stdout);
- ///freopen("contest.txt","w",stdout);
- #endif
- Do();
- return 0;
- }
Saturday, June 6, 2015
LightOJ - 1104 - Birthday Paradox
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment