Advertisement
Farjana_akter

Untitled

Feb 14th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. #include<math.h>
  3. using namespace std;
  4. double a[1000008];
  5. int main()
  6. {
  7. long long int n,b,t,i,c,j,k,d,e;
  8. a[0]=0;
  9. for(i=1;i<=1000005;i++){
  10. a[i]=a[i-1]+log(i);
  11. // cout<<a[i]<<endl;
  12. }
  13. cin>>t;
  14. for(k=1;k<=t;k++)
  15. {
  16. cin>>n>>b;
  17. c=(a[n]/log(b))+1;
  18. printf("Case %lld: %lld\n",k,c);
  19. }
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement