My issue
Can someone tell me when case did i miss, its almost right, i tried to determine the number of moves in the beginnning and then simulated the game for n moves.
My code
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(a) a.begin(),a.end()
int main() {
int t=1;
cin >> t;
while(t--)
{
long long A,B,X,Y;
cin >> A >> B >> X >> Y;
long long moves = (B) / Y;
if (X * moves <= (A + moves*Y))
cout << 0 << endl;
else
cout << 1 << endl;
}
return 0;
}
Problem Link: CodeChef: Practical coding for everyone