this is my code and i think my logic is correct but still its showing wrong answer can somebody tell me the fault. thanks in advance.
i went through your code.your logic is right but implentation is wrong.
the condition is:s*((1+c)^d-1)>=l;
this is the same condition you have used but to check this condition ,there is no need to find value of
s*((1+c)^d-1),which is the wrong you have commited.long long int can store up to 10^18 only but the left hand side value will be much more than that resulting in overflow which is the reason for your wrong answer. A simple implementation like this would suffice:
long long int count=1;
print(“ALIVE AND KICKING”)
print(“DEAD AND ROTTING”)