alexjercan/bugnet huggingface dataset:
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
// #ifndef ONLINE_JUDGE
// #  define LOG(x) (cerr << #x << " = " << (x) << endl)
// #else
// #  define LOG(x) 0
// #endif
#define pb push_back
#define mod 1000000007
#define endl '\\n'
typedef int integer;
#define int long long
using namespace std;

int powmod(int a, int b) {
  int res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1)
      res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}

int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }

const integer NN = 200005;
int ar[NN];
int n, m, k;

integer main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);

  int a, b, c, d;
  cin >> a >> b >> c >> d;
  k = 1;
  while (a > 0 && c > 0) {
    if (k) {
      c -= b;
    } else {
      a -= d;
    }
    k ^= 1;
  }
  if (!k)
    cout << "Yes";
  else
    cout << "No";
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
// #ifndef ONLINE_JUDGE
// #  define LOG(x) (cerr << #x << " = " << (x) << endl)
// #else
// #  define LOG(x) 0
// #endif
#define pb push_back
#define mod 1000000007
#define endl '\\n'
typedef int integer;
#define int long long
using namespace std;

int powmod(int a, int b) {
  int res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1)
      res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}

int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }

const integer NN = 200005;
int ar[NN];
int n, m, k;

integer main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);

  int a, b, c, d;
  cin >> a >> b >> c >> d;
  k = 1;
  while (a && c) {
    if (k) {
      c -= b;
    } else {
      a -= d;
    }
    k ^= 1;
  }
  if (!k)
    cout << "Yes";
  else
    cout << "No";
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;

  int kai_1 = C / B;
  int kai_2 = A / D;
  int a = C % B;
  int b = A % D;

  if (a) {
    kai_1++;
  }
  if (b) {
    kai_2++;
  }

  if (kai_1 <= kai_2) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;

int main() {
  int A, B, C, D;
  int attack = 1;
  cin >> A >> B >> C >> D;

  while (B > 0 && D > 0) {
    if (attack) {
      C -= B;
      attack = 0;
    } else {
      A -= D;
      attack = 1;
    }
  }

  if (A > 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;

  while (1) {

    c -= b;
    if (c <= 0) {
      cout << "Yes" << endl;
      break;
    }

    a -= d;
    if (a <= 0) {
      cout << "No" << endl;
      break;
    }
  }
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;

int main() {
  long long x, a = 100, ans = 0;
  cin >> x;

  while (a >= x) {
    a += a / 100;
    ans++;
  }

  cout << ans << endl;
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
int main() {
  using namespace std;
  int a, b, c, d;
  cin >> a;
  cin >> b;
  cin >> c;
  cin >> d;
  while (1) {
    c -= b;
    if (c <= 0) {
      cout << "Yes";
      break;
    }
    a -= d;
    if (a <= 0) {
      cout << "No";
      break;
    }
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
int main() {
  using namespace std;
  int a, b, c, d;
  cin >> a;
  cin >> b;
  cin >> c;
  cin >> d;
  c -= b;
  while (1) {
    if (c <= 0) {
      cout << "Yes";
      break;
    }
    a -= d;
    if (c <= 0) {
      cout << "No";
      break;
    }
  }
  return 0;
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  int x = (c / b);
  if (c % b)
    x++;
  int y = (a / d);
  if (a % d)
    y++;
  if (x <= y)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int A, B, C, D, E, count, count1;
  cin >> A >> B >> C >> D;

  count = 0;
  count1 = 0;
  for (int i = 1; B * i <= C; i++) {
    count++;
  }
  for (int i = 1; D * 1 <= A; i++) {
    count1++;
  }
  E = count - count1;
  if (E <= 1) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02700 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> i_i;

#define reps(i, s, n) for (int i = s; i < n; i++)
#define rep(i, n) reps(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define SZ(x) ((int)(x).size())
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  while (1) {
    C -= B;
    if (C <= 0) {
      cout << "Yes";
      return 0;
    }
    A -= D;
    if (A <= 0) {
      cout << "No";
      return 0;
    }
  }

  return 0;
}


Error: 1

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> i_i;

#define reps(i, s, n) for (int i = s; i < n; i++)
#define rep(i, n) reps(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define SZ(x) ((int)(x).size())
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  while (1) {
    C -= B;
    if (C <= 0)
      cout << "Yes", exit(1);
    A -= D;
    if (A <= 0)
      cout << "No", exit(1);
  }

  return 0;
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>

using namespace std;

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;

  while (true) {
    c -= b; // Attack
    if (c <= 0) {
      cout << "Yes" << endl;
      break;
    }
    a -= d; // Attack
    if (a <= 0) {
      cout << "No" << endl;
      break;
    }
  }
}

Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;

  while (true) {
    if (c - b <= 0) {
      cout << "Yes" << endl;
      break;
    }

    if (a - d <= 0) {
      cout << "No" << endl;
      break;
    }
  }
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
int a, b, c, d, i = 1;
int main() {
  cin >> a >> b >> c >> d;
  while (a > 0 && c > 0) {
    if (i & 1)
      c -= b;
    else
      a -= d;
    i++;
  }
  if (a <= 0)
    cout << "No";
  else
    cout << "Yes";
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
int a, b, c, d, i = 1;
int main() {
  cin >> a >> b >> c >> d;
  while (a > 0 && b > 0) {
    if (i & 1)
      c -= b;
    else
      a -= d;
  }
  if (a <= 0)
    cout << "No";
  else
    cout << "Yes";
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main(void) {
  int a, b, c, d;
  cin.exceptions(ios::failbit);

  try {
    cin >> a >> b >> c >> d;
  } catch (...) {
    return -1;
  }

  if ((a > 0 && a <= 100) && (b > 0 && b <= 100) && (c > 0 && c <= 100) &&
      (d > 0 && d <= 100)) {
    while (1) {
      c -= b;
      if (c <= 0) {
        cout << "Yes" << endl;
        break;
      }

      a -= d;

      if (a <= 0) {
        cout << "No" << endl;
        break;
      }
    }
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

int main(void) {
  int a, b, c, d;
  cin.exceptions(ios::failbit);

  try {
    cin >> a >> b >> c >> d;
  } catch (...) {
    return -1;
  }

  if ((a > 0 && a <= 100) && (b > 0 && b <= 100) && (c > 0 && c <= 100) &&
      (d > 0 && d <= 100)) {
    while (a > 0 || b > 0) {
      a -= d;
      c -= b;
    }

    if (a <= 0) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
  return 0;
}
Problem p02700 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  while (1) {
    C -= B;
    if (C <= 0) {
      cout << "Yes";
      break;
    }
    A -= D;
    if (A <= 0) {
      cout << "No";
      break;
    }
  }
  return 0;
}

Error: 1

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  while (1) {
    C -= B;
    if (C <= 0) {
      cout << "Yes";
      exit(1);
    }
    A -= D;
    if (A <= 0) {
      cout << "No";
      exit(1);
    }
  }
  return 0;
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
#define IOS                                                                    \\
  ios::sync_with_stdio(0);                                                     \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define endl "\\n"
#define ll long long
#define int long long
#define double long double
#define max(a, b) (a > b ? a : b)
#define min(a, b) (a < b ? a : b)
#define mp make_pair
#define pb push_back
#define inf INT_MAX
#define f first
#define s second
#define all(v) v.begin(), v.end()
const int N = 1e9 + 5;
vector<bool> primes(N, false);
bool isprime(int n) {
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0)
      return false;
  }
  return true;
}
// Sieve of Erastothenes
void sieve() {
  primes[2] = false;
  for (int i = 2; i * i <= N; i++) // this is actual marking
  {
    if (!primes[i]) {
      for (ll j = i * 2; j <= N; j += i) {
        primes[j] = true;
      }
    }
  }
}
int gcd(int a, int b) {
  if (b == 0)
    return a;
  a %= b;
  return gcd(b, a);
}

int32_t main() {
#ifndef ONLINE_JUDGE
  freopen("in.txt", "r", stdin);
  freopen("out.txt", "w", stdout);
#endif
  IOS int h1, s1, h2, s2;
  cin >> h1 >> s1 >> h2 >> s2;
  int mov = 0;
  while (true) {
    h2 -= s1;
    mov++;
    if (h2 <= 0)
      break;
    h1 -= s2;
    mov++;
    if (h1 <= 0)
      break;
  }
  if (mov & 1)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define IOS                                                                    \\
  ios::sync_with_stdio(0);                                                     \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define endl "\\n"
#define ll long long
#define int long long
#define double long double
#define max(a, b) (a > b ? a : b)
#define min(a, b) (a < b ? a : b)
#define mp make_pair
#define pb push_back
#define inf INT_MAX
#define f first
#define s second
#define all(v) v.begin(), v.end()
const int N = 1e9 + 5;
vector<bool> primes(N, false);
bool isprime(int n) {
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0)
      return false;
  }
  return true;
}
// Sieve of Erastothenes
void sieve() {
  primes[2] = false;
  for (int i = 2; i * i <= N; i++) // this is actual marking
  {
    if (!primes[i]) {
      for (ll j = i * 2; j <= N; j += i) {
        primes[j] = true;
      }
    }
  }
}
int gcd(int a, int b) {
  if (b == 0)
    return a;
  a %= b;
  return gcd(b, a);
}

int32_t main() {
#ifndef ONLINE_JUDGE
  freopen("in.txt", "r", stdin);
  freopen("out.txt", "w", stdout);
#endif
  IOS int h1, s1, h2, s2;
  cin >> h1 >> s1 >> h2 >> s2;
  int mov = 0;
  while (true) {
    h2 -= s1;
    mov++;
    if (h2 == 0)
      break;
    h1 -= s2;
    mov++;
    if (h1 == 0)
      break;
  }
  if (mov & 1)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  ll a, b, c, d;
  cin >> a >> b >> c >> d;
  int turn = 1;
  while (c > 0 && a > 0) {
    if (turn == 1) {
      turn ^= 1;
      c = c - b;
    } else {
      turn ^= 1;
      a = a - d;
    }
  }
  if (turn == 0)
    cout << "Yes";
  else
    cout << "No";
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  ll a, b, c, d;
  cin >> a >> b >> c >> d;
  int turn = 1;
  while (c != 0 && a != 0) {
    if (turn == 1) {
      turn ^= 1;
      c = c - b;
    } else {
      turn ^= 1;
      a = a - d;
    }
  }
  if (turn == 0)
    cout << "Yes";
  else
    cout << "No";
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  while (1) {
    c = c - b;
    a = a - d;
    if (c <= 0) {
      cout << "Yes";
      break;
    } else if (a <= 0) {
      cout << "No";
      break;
    }
  }
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  while (1) {
    int x = c - b;
    int y = a - d;
    if (x <= 0) {
      cout << "Yes";
      break;
    } else if (y <= 0) {
      cout << "No";
      break;
    }
  }
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) for (i = 0; i < n; ++i)
#define REP(i, k, n) for (i = k; i <= n; ++i)
#define REPR(i, k, n) for (i = k; i >= n; --i)
#define ll long long
// int check()
#include <string.h>

int main() {
  double h1, s1, h2, s2;
  cin >> h1 >> s1 >> h2 >> s2;
  double q = h2 / s1; // 1.1
  double w = h1 / s2; // 1
  // ll w1=h1%s2;
  if (ceil(q) > ceil(w))
    cout << "No";
  else
    cout << "Yes";

  return 0;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) for (i = 0; i < n; ++i)
#define REP(i, k, n) for (i = k; i <= n; ++i)
#define REPR(i, k, n) for (i = k; i >= n; --i)
#define ll long long
// int check()
#include <string.h>

int main() {
  ll h1, s1, h2, s2, flag;
  cin >> h1 >> s1 >> h2 >> s2;
  for (ll i = 0;; i++) {
    if (i % 2 == 0) {
      h2 -= s1;
      if (h2 == 0) {
        flag = 1;
        break;
      }
    } else {
      h1 -= s2;
      if (h1 == 0) {
        flag = 2;
        break;
      }
    }
  }
  if (flag == 1)
    cout << "Yes";
  else
    cout << "No";

  return 0;
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;

int main() {
  double A, B, C, D;
  cin >> A >> B >> C >> D;

  int i, j;
  i = ceil(C / B);
  j = ceil(A / D);

  if (j >= i) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;

  int i = 0;

  while (1) {
    A -= D;
    C -= B;
    if (A <= 0 && C > 0) {
      cout << "No" << endl;
      break;
    } else if (A > 0 && C <= 0) {
      cout << "Yes" << endl;
      break;
    }
    continue;
  }

  return 0;
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main(void) {

  cin.tie(0);
  ios::sync_with_stdio(false);

  int a, b, c, d;

  cin >> a >> b >> c >> d;

  for (;;) {

    c -= b;
    // cout << c << endl;
    if (c < 1) {
      cout << "Yes" << endl;
      return 0;
    }

    a -= d;
    // cout << a << endl;
    if (a < 1) {
      cout << "No" << endl;
      return 0;
    }
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main(void) {

  cin.tie(0);
  ios::sync_with_stdio(false);

  int a, b, c, d;

  cin >> a >> b >> c >> d;

  for (;;) {
    a -= d;
    if (a < 1) {
      cout << "yes" << endl;
    }
    c -= b;
    if (c < 1) {
      cout << "no" << endl;
    }
  }

  return 0;
}
Problem p02700 (C++) — buggy submission, verdict: Runtime Error

#include <bits/stdc++.h>
using namespace std;

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  int X = (C + B - 1) / B;
  int Y = (A + D - 1) / D;
  if (X > Y) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
}


Error: WA

Fixed submission:

#include <bits/stdc++.h>
using namespace std;

int main() {
  int A, B, C, D;
  cin >> A, B, C, D;
  if ((C + B) / B <= (A + D) / D) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int A, B, C, D, O, T;
  cin >> A >> B >> C >> D;
  O = C - B;
  T = A - D;
  if (O <= 0) {
    cout << "Yes" << endl;
  } else if (T <= 0) {
    cout << "No" << endl;
  } else if ((O > 0) && (T > 0)) {
    for (;;) {
      O = O - B;
      if (O <= 0) {
        cout << "Yes" << endl;
        break;
      }
      T = T - D;
      if (T <= 0) {
        cout << "No" << endl;
        break;
      }
    }
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
#include <string>
using namespace std;

int main() {
  int A, B, C, D, O, T;
  cin >> A >> B >> C >> D;
  while (1) {
    O = C - B;
    if (O <= 0) {
      cout << "Yes" << endl;
      break;
    }
    T = A - D;
    if (T <= 0) {
      cout << "No" << endl;
      break;
    }
  }
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define alpha_size 26

int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);

  int a, b, c, d;
  cin >> a >> b >> c >> d;

  int cnt = 1;
  bool takahashi = false, aoki = false;
  while (true) {
    if (cnt & 1)
      c -= b;
    else
      a -= d;
    if (a <= 0) {
      aoki = true;
      break;
    }
    if (c <= 0) {
      takahashi = true;
      break;
    }
    cnt++;
  }
  if (takahashi)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define alpha_size 26

int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);

  int a, b, c, d;
  cin >> a >> b >> c >> d;

  int cnt = 1;
  bool takahashi = false, aoki = false;
  while (!takahashi && !aoki) {
    if (cnt & 1)
      c -= b;
    else
      a -= d;
    if (a == 0) {
      aoki = true;
      break;
    }
    if (c == 0) {
      takahashi = true;
      break;
    }
    cnt++;
  }
  if (takahashi)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>

using namespace std;

#define boost                                                                  \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
#define ll long long unsigned int
#define vi vector<ll>
#define vvi vector<vi>
#define pii pair<int, int>
#define vii vector<pii>
#define pb push_back
#define B begin()
#define E end()
#define sz(A) (ll)(A).size()
#define F first
#define S second
#define loop(z, v) for (auto &z : v)
#define sp << ' ' <<
#define sps << ' '
#define nl "\\n"
// #define nl endl
#define fat 1000000007
// #define fat 998244353

int main() {
  boost;
  ll tt = 1, n, m, i, j, x, y, a, b, c, d;
  bool poss = true;

  // cin >> tt;
  for (int _ = 1; _ <= tt; _++) {
    // cout << "Case #" << _ << ": ";
    cin >> a >> b >> c >> d;

    int req1 = ceil((1.0 * c) / b);
    int req2 = ceil((1.0 * a) / d);

    if (req1 <= req2) {
      cout << "Yes" << nl;
    } else
      cout << "No" << nl;
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

#define boost                                                                  \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
#define ll long long unsigned int
#define vi vector<ll>
#define vvi vector<vi>
#define pii pair<int, int>
#define vii vector<pii>
#define pb push_back
#define B begin()
#define E end()
#define sz(A) (ll)(A).size()
#define F first
#define S second
#define loop(z, v) for (auto &z : v)
#define sp << ' ' <<
#define sps << ' '
#define nl "\\n"
// #define nl endl
#define fat 1000000007
// #define fat 998244353

int main() {
  boost;
  ll tt = 1, n, m, i, j, x, y, a, b, c, d;
  bool poss = true;

  // cin >> tt;
  for (int _ = 1; _ <= tt; _++) {
    // cout << "Case #" << _ << ": ";
    cin >> a >> b >> c >> d;

    i = 0;
    while (a > 0 and c > 0) {
      if (i % 2 == 0)
        c -= b;
      else
        a -= d;
      i++;
    }

    if (a > 0) {
      cout << "Yes" << nl;
    } else
      cout << "No" << nl;
  }
  return 0;
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>

using namespace std;

int main() {

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  int a, b, c, d;

  cin >> a >> b >> c >> d;

  while (1) {

    c -= b;

    if (c <= 0) {

      puts("Yes");

      return 0;
    }

    a -= d;

    if (a <= 0) {

      puts("No");

      return 0;
    }
  }

  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>

using namespace std;

int main() {

  int a, b, c, d;

  cin >> a >> b >> c >> d;

  while (1) {

    // T

    c -= b;

    // A

    a -= d;

    if (a <= 0 && c > 0) {

      cout << "No" << endl;

      break;

    }

    else if (c <= 0 && a > 0) {

      cout << "Yes" << endl;

      break;
    }
  }
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;

int main() {

  int a, b, c, d;
  cin >> a >> b >> c >> d;

  while (a >= 0 or c >= 0) {
    c = c - b;
    if (c <= 0) {
      cout << "Yes" << endl;
      break;
    }
    a = a - d;
    if (a <= 0) {
      cout << "No" << endl;
      break;
    }
  }
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;

int main() {

  int a, b, c, d;
  cin >> a;
  cin >> b;
  cin >> c;
  cin >> d;

  while (a >= 0 or c >= 0) {
    c - b;
    if (c <= 0) {
      cout << "Yes" << endl;
      break;
    }
    a - d;
    if (a <= 0) {
      cout << "No" << endl;
      break;
    }
  }
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int th, ts, ah, as;
  cin >> th >> ts >> ah >> as;
  while (th || ah == 0) {
    ah -= ts;
    if (ah <= 0) {
      cout << "Yes";
      return 0;
    }
    th -= as;
    if (th <= 0) {
      cout << "No";
      return 0;
    }
  }
  return 0;
}

Error: TLE

Fixed submission:

#include <bits/stdc++.h>
#include <time.h>
using namespace std;
int main() {
  int ht, st, ha, sa, i;
  cin >> ht >> st >> ha >> sa;
  while (ht || ha <= 0) {
    for (i = 1; i <= 1; i -= 0) {
      ha -= st;
      ht -= sa;
    }
    if (ht <= 0) {
      cout << "No";
      return 0;
    }
    if (st <= 0) {
      cout << "Yes";
      return 0;
    }
  }
}
Problem p02700 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <bits/stdc++.h>
using namespace std;

int main() {
  int t_H, t_P, A_H, A_P;
  cin >> t_H >> t_P >> A_H >> A_P;
  while (true) {
    A_H -= t_P;
    if (A_H <= 0) {
      cout << "Yes" << endl;
      break;
    }
    t_H -= A_P;
    if (t_H <= 0) {
      cout << "No" << endl;
      break;
    }
  }
}


Error: TLE

Fixed submission:

#include <bits/stdc++.h>
using namespace std;

int main() {
  int t_H, t_P, A_H, A_P;
  cin >> t_H >> t_P >> A_H >> A_P;
  while (true) {
    A_H -= t_P;
    if (A_H <= 0) {
      cout << "Yes" << endl;
    }
    t_H -= A_P;
    if (t_H <= 0) {
      cout << "No" << endl;
    }
  }
}