Anik_Akash

fact

Dec 28th, 2020 (edited)
118
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace    std;
  3.  
  4. #define flush        cin.ignore(numeric_limits<streamsize>::max(),'\n')
  5. #define fasterio     ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
  6. #define NL           printf("\n")
  7. #define fin          freopen("int.txt","r",stdin)
  8. #define fout         freopen("ans2.txt","w",stdout)
  9.  
  10.  
  11. typedef long long int       ll;
  12. typedef double              dl;
  13. typedef unsigned long long  ul;
  14.  
  15. // ------------------------------------Constants-------------------------------------//
  16.  
  17. #define pi           (acos(-1.0)) //3.1415926535897932384626
  18. #define mx           7500000
  19. #define dpoint(x)    fixed<<setprecision(x)
  20.  
  21. // --------------------------Pre made Functions & Proto Type--------------------------//
  22.  
  23. template <class T> T gcd(T a, T b){if(a == 0) return b;return gcd ( b%a, a );}
  24. template <class T> T lcm(T a, T b){return ( ( a/gcd ( a, b ) )*b );}
  25. template <class T> T digitsum(T n){T sum=0;while(n!=0){sum+=n%10;n/=10;}return sum;}
  26.  
  27.  
  28.  // -------------------------------------slove----------------------------------------//
  29.  //Code Status : ;
  30. int main()
  31. {
  32.    //fin;
  33.    //fout;
  34.    vector<int>num;
  35.     int sum=0,x;
  36.     for(int n=1; n<1000000000; n++){
  37.         x=n;
  38.         while(x>0){
  39.             x = x/5;
  40.             sum = sum+x;
  41.         }
  42.         num.push_back(sum);
  43.     }
  44.     int t, c;
  45.     cin>>t;
  46.    for(int i=0; i<t; i++){
  47.        cin>>c;
  48.        printf("Case %d: %d\n",i,num[c-1]);
  49.    }
  50.    return 0;
  51.    
  52. }
  53. /// ----------------------------Funaction Descriptions----------------------------------//
  54.  
  55. //author anikaksh;
RAW Paste Data