PLZLYKME - Editorial

Probably because you’ve exceeded the stack depth in Python

S=S*pow(C+1,D-1)
can u please explain bro how can you use this?

Solution:
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;

bool cal(ll l,ll d,ll s,ll c){
if(d==0) return false;
if(l<=s) return true;
s = s+c*s;
return cal(l,d-1,s,c);
}

int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
ll t;cin>>t;
while(t–){
ll l,d,s,c;
cin>>l>>d>>s>>c;
if(cal(l,d,s,c))cout<<“ALIVE AND KICKING”<<endl;
else cout<<“DEAD AND ROTTING”<<endl;
}
return 0;
}