My issue
My code
#include <stdio.h>
int main(void) {
// your code goes here
return 0;
}
Problem Link: CodeChef: Practical coding for everyone
#include <stdio.h>
int main(void) {
// your code goes here
return 0;
}
Problem Link: CodeChef: Practical coding for everyone
@govardhan_11
The logic i used in this question was like this;
Monster has H health points, it gains Y (Rate of gain) before a hit and loses X (Rate of loss) after every hit.
If the rate of health loss is greater than rate of health gain, it can be defeated.
Case 1: Rate of gain is more than or equal to rate of loss. (Y>=X).
Here, it is impossible to defeat the monster as its health point will either always be increasing or be constant.
Case2: Rate of gain is lower than rate of loss. (Y<X) or ((X-Y)>0)
Here, the monster will keep losing some health point at every strike and after a while its health H will reach zero. Thus, it is possible to defeat the monster.
if(y>=x):
print(0)
else:
print(1)