alexjercan/bugnet huggingface dataset:
Problem p02398 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;
int main() {
  int a, b, c, n = 0;
  cin >> a >> b >> c;
  for (int i = a; i <= b; i++) {
    if (c % i == 0)
      n++;
  }
  cout << n << endl;
  return 0;
}


Error: 100

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b, c, n = 0;
  cin >> a >> b >> c;
  for (int i = a; i <= b; i++) {
    if (c % i == 0)
      n++;
  }
  cout << n << endl;
  return 100;
}
Problem p02398 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>

int main() {
  int a = 0;
  int b = 0;
  int c = 0;

  scanf("%d", &a);
  scanf("%d", &b);
  scanf("%d", &c);

  int num_of_divisor = 0;
  int i = 0;

  for (i = a; i < b + 1; i++) {
    if (c % i == 0)
      num_of_divisor++;
  }

  printf("%d\\n", num_of_divisor);

  return 0;
}


Error: -11

Fixed submission:

#include <stdio.h>

int main() {
  int a = 0;
  int b = 0;
  int c = 0;

  scanf("%d", a);
  scanf("%d", b);
  scanf("%d", c);

  int num_of_divisor = 0;
  int i = 0;

  for (i = a; i < b + 1; i++) {
    if (c % i == 0)
      num_of_divisor++;
  }

  printf("%d", num_of_divisor);

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

#include <iostream>
using namespace std;

int main() {
  int a, b, c, d, count = 0, i = 1;
  cin >> a >> b >> c;
  while (1) {
    d = c / i;
    if (d < a)
      break;
    if (c % i == 0) {
      if (a <= d && d <= b)
        count += 1;
    }
    i += 1;
  }
  cout << count << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int a, b, c, d, count = 0, i = 1;
  cin >> a >> b >> c;
  while (1) {
    if (c % i == 0) {
      d = c / i;
      if (d < a)
        break;
      if (a <= d && d <= b)
        count += 1;
    }
    i += 1;
  }
  cout << count << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <stdio.h>

int main() {
  int a, b, c;
  int i;
  int ans = 0;
  scanf("%d %d %d", &a, &b, &c);

  for (i = a; i <= b; i++) {
    if (c % i == 0)
      ans++;
  }
  printf("%d\\n", ans);

  return 0;
}

Error: TLE

Fixed submission:

#include <stdio.h>

int main() {
  int a, b, c;
  int i;
  int ans = 0;
  scanf("%d %d %d", &a, &b, &c);

  for (i = a; i <= (b < (c / 2)) ? b : (c / 2); i++) {
    if (c % i == 0)
      ans++;
  }
  printf("%d\\n", ans);

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

#include <stdio.h>

int main() {
  int a, b, c, cnt = 0;
  scanf("%d %d %d", &a, &b, &c);

  for (int i = 1; i <= c; i++)
    if (c % i == 0)
      if (a <= i && i <= b)
        cnt++;
  printf("%d\\n", cnt);
  return 0;
}

Error: TLE

Fixed submission:

#include <algorithm>
#include <stdio.h>
int gcd(int a, int b) {
  if (b < a)
    std::swap(a, b);
  return b == 0 ? a : gcd(b, a % b);
}
int main() {
  int a, b, c, cnt = 0;
  scanf("%d %d %d", &a, &b, &c);

  for (int i = a; i <= b; i++)
    if (gcd(c, i) >= a)
      cnt++;
  printf("%d\\n", cnt);
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int a, b, c, s = 0;
  cin >> a >> b >> c;
  for (int i = a; i <= b; i++) {
    if (c % i == 0)
      s++;
  }
  cout << s << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b, c, s = 0;
  cin >> a >> b >> c;
  for (int i = a; a <= b; i++) {
    if (c % i == 0)
      s++;
  }
  cout << s << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int a, b, c, t = 0;
  cin >> a >> b >> c;
  for (int x = a; x <= b; x++) {
    if (c % x == 0)
      t++;
  }
  cout << t << endl;
  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b, c, t = 0;
  cin >> a >> b >> c;
  for (int x = a; a <= b; x++) {
    if (c % x == 0)
      t++;
  }
  cout << t << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Runtime Error

#include <stdio.h>
int main() {
  int a, b, c, i, d = 0;
  scanf("%d %d %d", &a, &b, &c);
  for (i = a; i <= b; i++) {
    if ((c % i) == 0)
      d++;
  }
  printf("%d\\n", d);
  return 0;
}

Error: -11

Fixed submission:

#include <stdio.h>
int main() {
  int a, b, c, i, d = 0;
  scanf("%d %d %d", &a, &b);
  for (i = a; i < b; i++) {
    if ((c % i) == 0)
      d++;
  }
  printf("%d\\n", d);
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>

int main() {
  int a, b, c, d;
  int cont = 0;

  std::cin >> a >> b >> c;
  d = c / 2;

  while (a <= b && a <= d) {
    if (c % a == 0) {
      cont++;
    }
    a++;
  }

  if (a <= c && c <= b) {
    cont++;
  }

  std::cout << cont << std::endl;
}

Error: TLE

Fixed submission:

#include <iostream>

int main() {
  int x, y;
  std::cin >> x >> y;

  while (x != 0 || y != 0) {
    if (x < y) {
      std::cout << x << " " << y << std::endl;
    } else {
      std::cout << y << " " << x << std::endl;
    }
    std::cin >> x >> y;
  }
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int a, b, c;
  int i;
  int n = 0;
  cin >> a;
  cin >> b;
  cin >> c;
  for (int i = a; i <= b; i++) {
    if (c % i == 0) {
      n++;
    }
  }
  cout << n << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b, c;
  int i;
  int n = 0;
  cin >> a;
  cin >> b;
  cin >> c;
  for (int i = a; a <= i <= b; i++) {
    if (c % i == 0) {
      n++;
    }
  }
  cout << n << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int a, b, c, x, y, n;
  n = 0;
  cin >> a >> b >> c;
  a <= b;
  1 <= a, b, c <= 10000;
  while (x <= b) {
    for (x = a; x <= b; x++)
      if (c % x == 0)
        n = n + 1;
  }
  cout << n << endl;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b, c, x, y, n, d;
  n = 0;
  d = 0;
  cin >> a >> b >> c;
  x = a;
  a <= b;
  1 <= a;
  b;
  c <= 100000000;
  while (x <= b) {
    cin >> a >> b >> c;
    for (x = a; x <= b - 1; x += 1)
      y = c / x;
    if (0 == c - (x * y))
      n = n += 1;
    else
      d = d += 1;
  }
  cout << n << endl;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int a, b, c, k, j;
  cin >> a >> b >> c;
  k = a;
  j = 0;
  while (1) {
    if (c % k == 0) {
      j += 1;
    }
    if (k == b)
      break;
    k += 1;
  }
  cout << j << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b, c, k, j;

  k = a;
  j = 0;
  while (1) {
    cin >> a >> b >> c;
    if (c % k == 0) {
      j += 1;
    }
    if (k == b)
      break;
    k += 1;
  }
  cout << k << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;

int main() {
  int a, b, c, count = 0;
  cin >> a >> b >> c;
  for (int i = a; i <= b; i++) {
    if (c % i == 0)
      count++;
  }
  cout << count << endl;
  return 0;
}


Error: WA

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int a, b, c, count = 0;
  for (int i = a; i <= b; i++) {
    cin >> a >> b >> c;
    if (c % i == 0)
      count++;
  }
  cout << count << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int a, b, c, x, y = 0;
  cin >> a >> b >> c;
  for (x = a; x <= b; x++) {
    if (c % x == 0)
      y++;
  }
  cout << y << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b, c, x, y = 0;
  cin >> a >> b >> c;
  for (x = a; x <= b, x++;) {
    if (c % x == 0)
      y++;
  }
  cout << y << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;
int main() {
  int a, b, c, d;
  d = 0;
  cin >> a >> b >> c;
  for (; a < b + 1; a = a + 1) {
    if (c % a == 0) {
      d = d + 1;
    }
  }
  cout << d << endl;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b, c, d;
  for (;;) {
    d = 0;
    cin >> a >> b >> c;
    for (; a < b + 1; a = a + 1) {
      if (c % a == 0) {
        d = d + 1;
      }
    }
    cout << d << endl;
  }
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

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

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int n = 0;
  for (int i = a; i <= b; i++) {
    if (c % i == 0)
      n++;
  }
  cout << n << endl;
}


Error: TLE

Fixed submission:

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

int main() {
  int a, b, c;
  int N = 0;
  cin >> a >> b >> c;
  for (int i = a; a < b; i++) {
    if (c % i == 0) {
      N++;
    }
  }
  cout << N << endl;
}
Problem p02398 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>

using namespace std;

int main() {

  int a, b, c;
  int count = 0;

  cin >> a >> b >> c;

  for (int num = a; num <= b; num++) {
    if (c % num == 0) {
      count++;
    }
  }

  cout << count << endl;

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

int main() {

  int a, b, c;
  int count = 0;

  for (int num = a; num <= b; num++) {
    if (num % c == 0) {
      count++;
    }
  }

  cout << count << endl;

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

#include <iostream>
using namespace std;
int main() {

  int a, b, c, r = 0, i;

  cin >> a >> b >> c;

  for (i = a; i <= b; i++) {

    if (c % i == 0) {
      r++;
    }
  }
  cout << r << endl;

  return 0;
}


Error: TLE

Fixed submission:

#include <algorithm>
#include <iostream>
using namespace std;
int main() {

  int a, b, c, x, i;
  cin >> a >> b >> c;
  i = 0;
  for (int x = a; x = b; x++) {
    if (c % x == 0) {
      i += 1;
    }
  }

  cout << i << endl;

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

#include <iostream>

using namespace std;

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

  for (int x = a; x <= b; x++) {
    if (c % x == 0)
      num++;
  }

  cout << num << '\\n';
}

Error: TLE

Fixed submission:

#include <iostream>

using namespace std;

int main() {
  int x, y;
  int foo;
  while (1) {
    cin >> x >> y;
    if (x == 0 && y == 0)
      break;
    if (x > y) {
      foo = x;
      x = y;
      y = foo;
    }
    cout << x << " " << y << "\\n";
  }
}
Problem p02398 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  double a;
  int A, B, C, D, E;

  cin >> A >> B >> C;

  for (int i = A; i <= B; i++) {
    a = C;
    E = C;
    a /= i;
    E /= i;

    if (a == E) {
      D++;
    }
  }

  cout << D << endl;

  return 0;
}


Error: -6
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::at: __n (which is 2) >= this->size() (which is 1)


Fixed submission:

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

int main() {
  double a, b, c;
  int A, B;
  string C;
  B = c;
  cin >> a >> b >> c;

  for (int i = a; i <= b; i++) {
    B /= i;
    B *= 10;
    C = B;
    if (C.at(C.size() + 1) == 0) {
      A++;
    }
    B = c;
  }

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

#include <iostream>
using namespace std;

int main() {
  int a, b, c;
  int x;
  int n = 0;

  while (1) {
    cin >> a >> b >> c;
    if (a <= b)
      break;
  }

  for (x = a; x <= b; x++) {
    if (c % x == 0)
      n++;
  }

  cout << n << endl;

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int a, b, c;
  int x;
  int n = 0;

  while (1) {
    cin >> a >> b >> c;
    if (a < b)
      break;
  }

  for (x = a; x <= b; x++) {
    if (c % x == 0)
      n++;
  }

  cout << n << endl;

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

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

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int cnt = 0;
  for (int x = a; x <= b; x++) {
    if (c % x == 0)
      cnt++;
  }
  cout << cnt << endl;
}


Error: TLE

Fixed submission:

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

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int cnt = 0;
  for (int x = a; x <= b; cnt++) {
    if (c % x == 0)
      cnt++;
  }
  cout << cnt << endl;
}
Problem p02398 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
using namespace std;
int main() {

  int a, b, c;
  int i = 0;
  cin >> a >> b >> c;
  int j = a;

  while (j <= b) {
    if (c % j == 0) {
      i++;
    }
    j++;
  }
  cout << i << endl;
  return 0;
}


Error: -8

Fixed submission:

#include <iostream>
using namespace std;
int main() {

  int a, b, c;
  int i = 0;
  // cout<< i <<endl;
  cin >> a >> b >> c;

  for (int j = 0; a <= j <= b; j++) {
    if (c % j == 0) {
      i++;
    }
  }
  cout << i << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Runtime Error

#include <cstdio>

int main() {
  int a, b, c, x, k;
  k = 0;
  scanf("%d %d %d", &a, &b, &c);
  for (int x = a; x <= b; x++) {
    if (c % x == 0) {
      k = k + 1;
    }
  }
  printf("%d\\n", k);
}


Error: -11

Fixed submission:

#include <cstdio>

int main() {
  int a, b, c, x, k, h;
  k = 0;
  scanf("%d %d %d", a, b, c);
  for (int x = a; x <= b; x++) {
    if (c % x == 0) {
      h = k + 1;
    }
  }
  printf("%d", h);
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int a, b, c, t;
  cin >> a >> b >> c;
  for (int x = a; x <= b; ++x) {
    if (c % x == 0)
      ++t;
  }
  cout << t << endl;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int a, b, c, t;
  cin >> a >> b >> c;
  for (int x = a; x <= b; ++a) {
    if (c % x == 0)
      ++t;
  }
  cout << t << endl;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int a, b, c, x;
  int count = 0;
  cin >> a >> b >> c;
  for (int x = a; x <= b; x++) {
    if (c % x == 0) {
      count += 1;
    }
  }
  cout << count << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int a, b, c, x, y, z;
  while (x >= a && x <= b) {
    if (c / x) {
      y = z;
      z = z + 1;
    } else {
      y = z;
      z = z + 1 - 1;
    }
  }
  cout << "z" << endl;
  return 0;
}
Problem p02398 (C++) — buggy submission, verdict: Time Limit Exceeded

#include <iostream>
using namespace std;

int main() {
  int a, b, c;
  int n = 0;
  cin >> a >> b >> c;
  while (1) {
    if (c % a == 0) {
      n++;
    }
    if (a == b) {
      break;
    }
    a++;
  }
  cout << n << endl;

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int a, b, c;
  int n = 0;
  cin >> a >> b >> c;
  while (1) {
    if (c % a == 0) {
      n++;
    }
    if (a == b) {
      break;
    }
  }
  cout << n << endl;

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

#include <iostream>
using namespace std;

int main() {
  int a, b, c, cnt = 0;
  cin >> a >> b >> c;
  for (int i = a; i <= b; i++) {
    if (c % i == 0)
      cnt++;
  }
  cout << cnt << endl;
  return 0;
}


Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int a, b, c, cnt = 0;
  cin >> a >> b >> c;
  for (int i = a; a <= b; i++) {
    if (c % i == 0)
      cnt++;
  }
  cout << cnt << endl;
  return 0;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

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

int main() {

  cout << fixed << setprecision(6);

  int a, b;

  cin >> a >> b;

  cout << a / b << " ";

  cout << a % b << " ";

  cout << (double)a / b << endl;

  return 0;
}


Error: WA

Fixed submission:

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

int main() {

  int a, b;

  double f = a / b;

  cin >> a >> b;

  cout << a / b << " " << a % b << " " << endl;

  printf("%.5lf＼n", f);

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

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

int main() {
  int a, b;

  cin >> a >> b;

  int d = a / b;
  int r = a % b;
  double f = (double)a / (double)b;

  // fixed
  // ??¨????????????????????°????????????????°???°?????\\???????????°?????????
  cout << d << " " << r << " " << fixed << setprecision(5) << f << "\\n";

  return 0;
}

Error: TLE

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  while (1) {

    int a, b;
    cin >> a >> b;
    int d = a / b;
    int r = a % b;
    float f = (float)a / (float)b;

    // showpoint?°???°?????\\??????0???????????????
    cout.precision(20);
    cout << d << " " << r << " " << showpoint << f << "\\n";
  }

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

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

int a, b;
int d, r;
double f;

int main() {
  cin >> a >> b;
  d = a / b;
  r = a % b;
  f = (1.0 * double(a)) / double(b);
  cout << d << " " << r << " " << fixed << setprecision(5) << f << endl;

  return 0;
}

Error: -8

Fixed submission:

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

int a, b, d, r;
double f;

int main() {
  d = a / b;
  r = a % b;
  f = a / b;
  cout << d << r << f << endl;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

#include <iomanip>
#include <iostream>
using namespace std;
int main(void) {
  int a, b;
  double f;
  cin >> a >> b;
  f = (double)a / b;
  cout << a / b << " " << a % b << " " << fixed << f << endl;
}

Error: WA

Fixed submission:

#include <iostream>
using namespace std;
int main(void) {
  int a, b;
  cin >> a, b;
  float f;
  f = a / b;
  cout << a / b << " " << a % b << " " << f << endl;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  int a, b;
  cin >> a >> b;
  printf("%d %d %.8f", a / b, a % b, (double)a / (double)b);
  return 0;
}

Error: WA

Fixed submission:

#include <iostream>
using namespace std;

int main() {
  int a, b;
  cin >> a, b;
  cout << a / b << (a % b) << (float)a / (float)b << endl;
  return 0;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  int a, b;
  cin >> a >> b;
  printf("%d %d %f\\n", a / b, a % b, (double)a / b);
  return 0;
}


Error: WA

Fixed submission:

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

int main() {
  int a, b;
  double d, f;
  d = a / b;
  f = 1.00000 * a / b;
  cout << d << " " << a % b << " " << f << endl;
  return 0;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

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

int main() {
  int a, b, d, r;
  double f;

  scanf("%d %d", &a, &b);

  d = a / b;
  r = a % b;
  f = (double)a / b;

  printf("%d %d %f\\n", d, r, f);

  return 0;
}


Error: -11

Fixed submission:

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

int main() {
  int a, b, d, r;
  double f;

  scanf("%d %d", a, b);

  d = a / b;
  r = a % b;
  f = (double)a / b;

  printf("%d %d %f\\n", d, r, f);

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

#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  cout << a / b << " " << a % b << " ";
  printf("%.5f\\n", (double)a / b);
  return 0;
}

Error: WA

Fixed submission:

#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cout << a / b << " " << a % b << " " << 1.0 * a / b << endl;
  return 0;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

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

int main() {

  cout << fixed << setprecision(12);

  int a, b;
  cin >> a >> b;

  cout << a / b << " ";
  cout << a % b << " ";
  cout << (double)a / b << endl;

  return 0;
}


Error: WA

Fixed submission:

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

int main() {

  cout << fixed << setprecision(12);

  int a, b;

  cout << a / b << " ";
  cout << a % b << " ";
  cout << (double)a / b << endl;

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

#include <iostream>
using namespace std;
#include <cstdio>
int main() {
  int x, y;
  cin >> x >> y;
  cout << x / y << endl;
  cout << x % y << endl;
  printf("%.5lf", (double)x / y);
  return 0;
}

Error: WA

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int x, y;
  int a = 0, b = 0;
  double c = 0;
  a = x / y;
  b = x % y;
  c = (double)x / y;
  cin >> x >> y;
  cout << a << b << c << endl;
  return 0;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  printf("%d %d %f\\n", a / b, a % b, (double)a / b);
  return 0;
}


Error: WA

Fixed submission:

#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
  int a, b;
  cin >> a, b;
  printf("%d %d %f\\n", a / b, a % b, (double)a / b);
  return 0;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>

using namespace std;

int main() {
  int a, b;
  cin >> a >> b;
  printf("%d %d %.5f\\n", a / b, a % b, (double)a / b);
}

Error: WA

Fixed submission:

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>

using namespace std;

int main() {
  int a, b;
  printf("%d %d %.5f\\n", a / b, a % b, (double)a / b);
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

#include <iomanip>
#include <iostream>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  cout << a / b << " " << a % b << " " << fixed << setprecision(5)
       << (double)a / b << endl;
}

Error: WA

Fixed submission:

#include <iostream>
using namespace std;
int main() {
  int a, b;
  cout << a / b << " " << a % b << " " << (double)a / b << endl;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
#include <stdio.h>

using namespace std;

int main() {
  long int a = 0;
  long int b = 0;

  cin >> a >> b;

  printf("%d %d %f\\n", a / b, a % b, a / (double)b);

  return 0;
}


Error: -11

Fixed submission:

#include <stdio.h>

int main() {
  long int a = 0;
  long int b = 0;

  scanf("%d", a);
  scanf("%d", b);

  printf("%d %d %f\\n", a / b, a % b, a / (double)b);

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

#include <stdio.h>
main() {
  int a, b;
  double c;

  scanf("%d%d", &a, &b);
  c = (double)a / b;
  printf("%d %d %f\\n", a / b, a % b, c);

  return 0;
}

Error: WA

Fixed submission:

#include <stdio.h>
int main() {
  int a, b, c, d;
  double f;
  scanf("%d %d", &a, &b);
  c = a / b;
  d = a % d;
  f = a / d;
  printf("%d %d %d\\n", c, d, f);
  return 0;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

#include <cstdio>
#include <iostream>

using namespace std;

int main() {
  int a, b, r;

  cin >> a >> b;
  printf("%d %d %.7f", a / b, a % b, (double)a / (double)b);
}


Error: WA

Fixed submission:

#include <cstdio>
#include <iostream>

using namespace std;

int main() {
  int a, b, r;
  double f;
  char str[50];

  cin >> a >> b;
  sprintf(str, "%d %d %.7f ", a / b, a % r, (double)a / (double)b);
  cout << str << endl;
}
Problem p02399 (C++) — buggy submission, verdict: Runtime Error

#include <cstdio>

using namespace std;

int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("%d %d %.5lf", a / b, a % b, (double)a / b);
}

Error: -8

Fixed submission:

#include <cstdio>

using namespace std;

int main() {
  int a, b, d, r;
  double f;
  d = a / b;
  r = a % b;
  f = (double)a / b;
  scanf("%d %d", &a, &b);
  printf("%d %d %.5lf\\n", d, r, f);
}