Advertisement
Saleh127

Untitled

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