Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define flush cin.ignore(numeric_limits<streamsize>::max(),'\n')
- #define fasterio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
- #define NL printf("\n")
- #define fin freopen("int.txt","r",stdin)
- #define fout freopen("ans2.txt","w",stdout)
- typedef long long int ll;
- typedef double dl;
- typedef unsigned long long ul;
- // ------------------------------------Constants-------------------------------------//
- #define pi (acos(-1.0)) //3.1415926535897932384626
- #define mx 7500000
- #define dpoint(x) fixed<<setprecision(x)
- // --------------------------Pre made Functions & Proto Type--------------------------//
- template <class T> T gcd(T a, T b){if(a == 0) return b;return gcd ( b%a, a );}
- template <class T> T lcm(T a, T b){return ( ( a/gcd ( a, b ) )*b );}
- template <class T> T digitsum(T n){T sum=0;while(n!=0){sum+=n%10;n/=10;}return sum;}
- // -------------------------------------slove----------------------------------------//
- //Code Status : ;
- int main()
- {
- //fin;
- //fout;
- vector<int>num;
- int sum=0,x;
- for(int n=1; n<1000000000; n++){
- x=n;
- while(x>0){
- x = x/5;
- sum = sum+x;
- }
- num.push_back(sum);
- }
- int t, c;
- cin>>t;
- for(int i=0; i<t; i++){
- cin>>c;
- printf("Case %d: %d\n",i,num[c-1]);
- }
- return 0;
- }
- /// ----------------------------Funaction Descriptions----------------------------------//
- //author anikaksh;
Add Comment
Please, Sign In to add comment