Problem link : Sheldon vs Kripke
Difficulty : Easy
Setter : Harshit Garg
Explanation :
If they continue to attack each other even after the health of either robot becomes 0 or below, then the health of Sheldon’s robot becomes 0 or less in the ceil of (A/D)-th Kripke’s attack, and the health of Kripke’s robot becomes 0 or less in the ceil of (B/C)-th Kripke’s attack. Therefore, let X be ceil of (A/D) and Y be ceil of (B/C), and Sheldon will win if X ≥ Y , and Kripke will win otherwise. Note that Sheldon will win when X = Y because Sheldon takes turn first.
Code :
#include<bits/stdc++.h>
using namespace std;
int main()
{
int A,B,C,D;
cin>>A>>B>>C>>D;
int X= (A+D-1)/D;
int Y= (C+B-1)/B;
cout<<(X>=Y?"YES":"NO")<<endl;
return 0;
}