Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
shrutashraba authored Oct 4, 2021
1 parent fdfe969 commit 5787c26
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Food Chain.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include<bits/stdc++.h>
using namespace std ;

#define ff first
#define ss second
#define ull unsigned long long
#define mod 1000000007
#define inf 1e18
#define w(x) int x;cin>>x;while(x--)
#define f(x,y) for( x=0;x<y;x++)

int main(){
w(t){
long long e,k;
cin>>e>>k;
//int c=log(e)/log(k);
int counter=1 ;
float c = e/k;
while(floor(c)>=1){
counter++;
c=c/k;
}
//cout<<c<<endl;
cout<<counter<<endl;
}

return 0;
}

0 comments on commit 5787c26

Please sign in to comment.