prithivMLmods/Coder-Stat huggingface dataset:
Problem p02397 (C++)

Buggy submission (status: Runtime Error):
#include <cstdio>

int main() {
  int x, y;
  while (1) {
    scanf("%d %d", x, y);
    if (x == 0 && y == 0)
      break;
    if (x > y) {
      printf("%d %d\n", y, x);
    } else {
      printf("%d %d\n", x, y);
    }
  }

  return 0;
}

Fixed submission:
#include <cstdio>

int main() {
  int x, y;
  while (1) {
    scanf("%d %d", &x, &y);
    if (x == 0 && y == 0)
      break;
    if (x > y) {
      printf("%d %d\n", y, x);
    } else {
      printf("%d %d\n", x, y);
    }
  }

  return 0;
}
Problem p02397 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;
int main() {
  int x, y;
  for (;;) {
    cin >> x >> y;
    if (x > y) {
      cout << y << " " << x << endl;
    } else if (x <= y) {
      cout << x << " " << y << endl;
    }
  }
}


Fixed submission:
#include <iostream>
using namespace std;
int main() {
  int x, y;
  for (;;) {
    cin >> x >> y;
    if (x < 1 && y < 1) {
      return 0;
    }
    if (x > y) {
      cout << y << " " << x << endl;
    } else if (x <= y) {
      cout << x << " " << y << endl;
    }
  }
}
Problem p02397 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>

using namespace std;

int main() {
  int in1, in2;

  cin >> in1 >> in2;

  while ((in1 != 0) || (in2 != 0)) {
    if (in1 < in2)
      cout << in1 << ' ' << in2 << endl;
    else
      cout << in2 << ' ' << in1 << endl;
    cin >> in1, in2;
  }
  return 0;
}

Fixed submission:
#include <iostream>

using namespace std;

int main() {
  int in1, in2;

  cin >> in1 >> in2;

  while ((in1 != 0) || (in2 != 0)) {
    if (in1 < in2)
      cout << in1 << ' ' << in2 << endl;
    else
      cout << in2 << ' ' << in1 << endl;
    cin >> in1 >> in2;
  }
  return 0;
}
Problem p02397 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;

int main() {
  int x, y;
  while (true) {
    cin >> x >> y;
    if ((x | y) != 0) {
      if (x < y) {
        cout << x << " " << y << endl;
      } else {
        cout << y << " " << x << endl;
      }
    }
  }
  return 0;
}

Fixed submission:
#include <iostream>
using namespace std;

int main() {
  int x, y;
  while (true) {
    cin >> x >> y;
    if ((x | y) != 0) {
      if (x < y) {
        cout << x << " " << y << endl;
      } else {
        cout << y << " " << x << endl;
      }
    } else {
      break;
    }
  }
  return 0;
}
Problem p02397 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
using namespace std;

int main(void) {

  string input;
  int num[2];
  int counter = 0;
  istringstream stream(input);

  while (getline(cin, input)) {
    stream.str("");
    stream.clear(stringstream::goodbit);
    stream.str(input);
    stream >> num[0] >> num[1];
    if (num[0] == 0 && num[1] == 0)
      break;
    else if (num[0] <= num[1])
      cout << num[0] << " " << num[1] << "\n";
    else
      cout << num[1] << " " << num[0] << "\n";
  }

  return 1;
}

Fixed submission:
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
using namespace std;

int main(void) {

  string input;
  int num[2];
  int counter = 0;
  istringstream stream(input);

  while (getline(cin, input)) {
    stream.str("");
    stream.clear(stringstream::goodbit);
    stream.str(input);
    stream >> num[0] >> num[1];
    if (num[0] == 0 && num[1] == 0)
      break;
    else if (num[0] <= num[1])
      cout << num[0] << " " << num[1] << "\n";
    else
      cout << num[1] << " " << num[0] << "\n";
  }
}
Problem p02397 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <stdio.h>
int main() {
  int x, y;
  for (;;) {
    scanf("%d %d", &x, &y);
    if (x < y) {
      printf("%d %d\n", x, y);
    } else if (y < x) {
      printf("%d %d\n", y, x);
    } else if (x == y) {
      printf("%d %d\n", x, y);
    } else if (x == 0 && y == 0) {
      break;
    }
  }
  return 0;
}

Fixed submission:
#include <stdio.h>
int main() {
  int x, y;
  for (;;) {
    scanf("%d %d", &x, &y);
    if (x < y) {
      printf("%d %d\n", x, y);
    } else if (y < x) {
      printf("%d %d\n", y, x);
    } else if (x == y && x != 0 && y != 0) {
      printf("%d %d\n", x, y);
    } else if (x == 0 && y == 0) {
      break;
    }
  }
  return 0;
}
Problem p02397 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;
int main() {
  int a, b, emp;
  for (int i = 1;; i++) {
    cin >> a >> b;
    if (a > b) {
      emp = a;
      a = b;
      b = emp;
      cout << a << " " << b << endl;
    } else
      cout << a << " " << b << endl;
  }
  return 0;
}

Fixed submission:
#include <iostream>
using namespace std;
int main() {
  int a, b, emp;
  for (int i = 1;; i++) {
    cin >> a >> b;
    if (a == 0 && b == 0)
      break;
    if (a > b) {
      emp = a;
      a = b;
      b = emp;
      cout << a << " " << b << endl;
    } else
      cout << a << " " << b << endl;
  }
  return 0;
}
Problem p02397 (C++)

Buggy submission (status: Time Limit Exceeded):
#define _GRIBCXX_DEBUG
#include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <string>
#include <utility>
#include <vector>
using namespace std;

// ?????¬???????????¬??????
#define REP(i, n) for (int i = 0; i < (int)n; ++i)
#define FOR(i, c)                                                              \
  for (__typeof((c).begin()) != (c).begin(); i != (c).end(); ++i)
#define ALL(c) (c).begin(), c.end()

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<double> vd;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<long, long> pil;

// ??°?????????????????¬??????
typedef int Weight;

struct Edge {
  int src, dst;
  Weight weight;
  Edge(int src, int dst, Weight weight) : src(src), dst(dst), weight(weight) {}
};

bool operator<(const Edge &e, const Edge &f) {
  return e.weight != f.weight ? e.weight > f.weight
         : e.src != f.src     ? e.src < f.src
                              : e.dst < f.dst;
}

typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
typedef vector<Weight> Array;
typedef vector<Array> Matrix;

int main() {
  int a, b;
  while (scanf("%d %d", &a, &b)) {
    printf("%d %d\n", min(a, b), max(a, b));
  }
  return 0;
}

Fixed submission:
#define _GRIBCXX_DEBUG
#include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <string>
#include <utility>
#include <vector>
using namespace std;

// ?????¬???????????¬??????
#define REP(i, n) for (int i = 0; i < (int)n; ++i)
#define FOR(i, c)                                                              \
  for (__typeof((c).begin()) != (c).begin(); i != (c).end(); ++i)
#define ALL(c) (c).begin(), c.end()

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<double> vd;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<long, long> pil;

// ??°?????????????????¬??????
typedef int Weight;

struct Edge {
  int src, dst;
  Weight weight;
  Edge(int src, int dst, Weight weight) : src(src), dst(dst), weight(weight) {}
};

bool operator<(const Edge &e, const Edge &f) {
  return e.weight != f.weight ? e.weight > f.weight
         : e.src != f.src     ? e.src < f.src
                              : e.dst < f.dst;
}

typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
typedef vector<Weight> Array;
typedef vector<Array> Matrix;

int main() {
  int a, b;
  while (true) {
    scanf("%d %d", &a, &b);
    if (a == 0 && b == 0)
      break;
    else
      printf("%d %d\n", min(a, b), max(a, b));
  }
  return 0;
}
Problem p02397 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <stdio.h>
int main() {
  for (int i = 0;; i++) {
    int a, b, r;
    scanf("%d %d", &a, &b);
    if (a > b) {
      r = a;
      a = b;
      b = r;
    }
    printf("%d %d\n", a, b);
  }
}


Fixed submission:
#include <stdio.h>
int main() {
  for (int i = 0;; i++) {
    int a, b, r;
    scanf("%d %d", &a, &b);
    if ((a == 0) && (b == 0))
      break;
    if (a > b) {
      r = a;
      a = b;
      b = r;
    }
    printf("%d %d\n", a, b);
  }
}
Problem p02397 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;

int main() {
  int x, y;

  cin >> x >> y;
  while (x | y) {
    if (x < y)
      cout << x << " " << y << endl;
    else
      cout << y << " " << x << endl;
  }

  return 0;
}

Fixed submission:
#include <iostream>
using namespace std;

int main() {
  int x, y;

  for (cin >> x >> y; x | y; cin >> x >> y) {
    if (x < y)
      cout << x << " " << y << endl;
    else
      cout << y << " " << x << endl;
  }

  return 0;
}
Problem p02397 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <iostream>
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>

using namespace std;

int main() {
  while (true) {
    int x, y;
    cin >> x;
    cin >> y;

    int small, large;

    if (x < y) {
      small = x;
      large = y;

    } else {
      small = y;
      large = x;
    }

    cout << small << " " << large << endl;
  }
}

Fixed submission:
#include <algorithm>
#include <iostream>
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>

using namespace std;

int main() {
  while (true) {
    int x, y;
    cin >> x;
    cin >> y;

    if (x == 0 && y == 0) {
      break;
    }

    int small, large;

    if (x < y) {
      small = x;
      large = y;

    } else {
      small = y;
      large = x;
    }

    cout << small << " " << large << endl;
  }
}
Problem p02397 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <stdio.h>

int main(void) {
  int x, y;

  scanf("%d%d", &x, &y);
  while (x != 0 || y != 0) {
    printf("%d %d\n", x < y ? x : y, x < y ? y : x);
  }
  return 0;
}

Fixed submission:
#include <stdio.h>

int main(void) {
  int x, y;

  scanf("%d%d", &x, &y);
  while (x != 0 || y != 0) {
    printf("%d %d\n", x < y ? x : y, x < y ? y : x);
    scanf("%d%d", &x, &y);
  }
  return 0;
}
Problem p02397 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
  int x[3000], y[3000];
  int i = 0;
  int swap;
  for (i = 0; i < 100000; ++i) {
    scanf("%d%d", x[i], y[i]);
    if (x[i] == 0 && y[i] == 0)
      break;
    if (x[i] > y[i]) {
      swap = x[i];
      x[i] = y[i];
      y[i] = swap;
    }
  }
  for (int j = 0; j < i; ++j)
    cout << x[j] << " " << y[j] << endl;
  return 0;
}

Fixed submission:
#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
  int x[3000], y[3000];
  int i = 0;
  int swap;
  for (i = 0; i < 100000; ++i) {
    scanf("%d%d", &x[i], &y[i]);
    if (x[i] == 0 && y[i] == 0)
      break;
    if (x[i] > y[i]) {
      swap = x[i];
      x[i] = y[i];
      y[i] = swap;
    }
  }
  for (int j = 0; j < i; ++j)
    cout << x[j] << " " << y[j] << endl;
  return 0;
}
Problem p02397 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

int main() {

  while (1) {
    int x, y;
    cin >> x >> y;
    if (x > y)
      swap(x, y);
    cout << x << " " << y << endl;
  }

  return 0;
}


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

int main() {

  while (1) {
    int x, y;
    cin >> x >> y;
    if (x == 0 && y == 0)
      break;

    if (x > y)
      swap(x, y);
    cout << x << " " << y << endl;
  }

  return 0;
}
Problem p02397 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;

int main() {
  int x, y, p;

  for (;;) {
    cin >> x >> y;

    if (x > y) {
      p = x;
      x = y;
      y = p;
    }
    if (x && y == 0)
      break;
    cout << x << " " << y << endl;
  }

  return 0;
}

Fixed submission:
#include <iostream>
using namespace std;

int main() {
  int x, y, p;

  for (;;) {
    cin >> x >> y;

    if (x > y) {
      p = x;
      x = y;
      y = p;
    }
    if (x == 0 && y == 0)
      break;
    cout << x << " " << y << endl;
  }

  return 0;
}
Problem p02397 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
int main() {
  while (1) {
    int x, y;
    cin >> x, y;
    if (x == 0 && y == 0)
      break;
    if (x > y)
      swap(x, y);
    cout << x << " " << y << endl;
  }
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  while (1) {
    int x, y;
    cin >> x >> y;
    if (x == 0 && y == 0)
      break;
    if (x > y)
      swap(x, y);
    cout << x << " " << y << endl;
  }
  return 0;
}
Problem p02398 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;

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

  int count = 0;
  for (int i = a; a <= b; i++)
    if (c % i == 0)
      count++;

  cout << count << endl;
}


Fixed submission:
#include <iostream>
using namespace std;

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

  int count = 0;
  for (int i = a; i <= b; i++)
    if (c % i == 0)
      count++;

  cout << count << endl;
}
Problem p02398 (C++)

Buggy submission (status: Runtime Error):
// class point	の練習（クラスの高度な実装）
#include <iostream>
using namespace std;

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

  cin >> a >> b >> c;

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


Fixed submission:
// class point	の練習（クラスの高度な実装）
#include <iostream>
using namespace std;

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

  cin >> a >> b >> c;

  for (int i = a; i <= b; i++) {
    if (c % i == 0)
      cnt++;
  }
  cout << cnt << endl;
  return 0;
}
Problem p02398 (C++)

Buggy submission (status: 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; cnt++) {
    if (c % x == 0)
      cnt++;
  }
  cout << cnt << endl;
}


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; x++) {
    if (c % x == 0)
      cnt++;
  }
  cout << cnt << endl;
}
Problem p02398 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <stdio.h>

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


Fixed submission:
#include <stdio.h>

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

Buggy submission (status: Runtime Error):
#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;
}

Fixed submission:
#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;
}
Problem p02398 (C++)

Buggy submission (status: Time Limit Exceeded):
#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;
}

Fixed submission:
#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;
}
Problem p02398 (C++)

Buggy submission (status: 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;
}

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 (status: 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 < (c / 2)) ? b : (c / 2); i++) {
    if (c % i == 0)
      ans++;
  }
  printf("%d\n", ans);

  return 0;
}

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; i++) {
    if (c % i == 0)
      ans++;
  }
  printf("%d\n", ans);

  return 0;
}
Problem p02398 (C++)

Buggy submission (status: 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;
}


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 (status: 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;
    }
  }
  cout << n << endl;

  return 0;
}

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;
    }
    a++;
  }
  cout << n << endl;

  return 0;
}
Problem p02398 (C++)

Buggy submission (status: 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++;
  }

  return n;
}


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 0;
}
Problem p02398 (C++)

Buggy submission (status: Time Limit Exceeded):
#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;
}

Fixed submission:
#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;
}
Problem p02398 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;
int main() {
  int a, b, c;
  int count = 0;
  cin >> a >> b >> c;
  if (c % a == 0)
    count += 1;
  while (++a != b) {
    if (c % a == 0)
      count++;
  }
  cout << count << endl;
}


Fixed submission:
#include <iostream>
using namespace std;
int main() {
  int a, b, c;
  int count = 0;
  cin >> a >> b >> c;
  for (int i = a; i <= b; i++) {
    if (c % i == 0)
      count += 1;
  }
  cout << count << endl;
}
Problem p02398 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>

using namespace std;

int main() {
  int x, y, z;
  int i, l;

  l = 0;

  cin >> x;
  cin >> y;
  cin >> z;

  for (i = x; i <= y; i++) {
    if ((z % i) == 0) {
      l++;
    }
  }

  cout << l << endl;

  while (1)
    ;

  return 0;
}

Fixed submission:
#include <iostream>

using namespace std;

int main() {
  int x, y, z;
  int i, l;

  l = 0;

  cin >> x;
  cin >> y;
  cin >> z;

  for (i = x; i <= y; i++) {
    if ((z % i) == 0) {
      l++;
    }
  }

  cout << l << endl;

  return 0;
}
Problem p02398 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;

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

  cin >> a >> b >> c;

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

Fixed submission:
#include <iostream>
using namespace std;

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

  cin >> a >> b >> c;

  for (int i = a; i <= b; i++) {
    if (c % i == 0) {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
Problem p02398 (C++)

Buggy submission (status: 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; ++a) {
    if (c % x == 0)
      ++t;
  }
  cout << t << endl;
}


Fixed submission:
#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;
}
Problem p02398 (C++)

Buggy submission (status: 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; a <= i <= b; i++) {
    if (c % i == 0) {
      n++;
    }
  }
  cout << n << endl;
  return 0;
}


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; i <= b; i++) {
    if (c % i == 0) {
      n++;
    }
  }
  cout << n << endl;
  return 0;
}
Problem p02398 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;

int main() {
  int a, b, c, sum;
  cin >> a >> b >> c;
  sum = 0;

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

  cout << sum << endl;
  return 0;
}

Fixed submission:
#include <iostream>
using namespace std;

int main() {
  int a, b, c, sum;
  cin >> a >> b >> c;
  sum = 0;

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

  cout << sum << endl;
  return 0;
}
Problem p02398 (C++)

Buggy submission (status: Time Limit Exceeded):
#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;
}


Fixed submission:
#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;
}
Problem p02398 (C++)

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

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 0;
}
Problem p02398 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

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


Fixed submission:
#include <bits/stdc++.h>
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;
}
Problem p02398 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;

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

  for (; a != b; b++) {
    if (c % b == 0)
      d += 1;
  }
  cout << d << endl;
  return 0;
}

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

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

  for (int i = a; i <= b; i++) {
    if (c % i == 0)
      d += 1;
  }
  cout << d << endl;
  return 0;
}
Problem p02398 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>

using namespace std;

int main(void) {

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

  cin >> a >> b >> c;

  while (a <= b) {
    if (c % a == 0)
      a++;
    count++;
  }

  cout << count << endl;

  return 0;
}

Fixed submission:
#include <iostream>

using namespace std;

int main(void) {

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

  cin >> a >> b >> c;

  while (a <= b) {
    if (c % a == 0)
      count++;
    a++;
  }

  cout << count << endl;

  return 0;
}
Problem p02398 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;

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

Fixed submission:
#include <iostream>
using namespace std;

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

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;
int main() {
  int a, b, c, count;
  cin >> a >> b >> c;
  for (int i = a; i <= b; i + 1) {
    if (c % i == 0) {
      count = count + 1;
    }
  }
  cout << count << endl;
  return 0;
}


Fixed submission:
#include <iostream>
using namespace std;
int main() {
  int a, b, c, count;
  cin >> a >> b >> c;
  for (int i = a; i <= b; i++) {
    if (c % i == 0) {
      count = count + 1;
    }
  }
  cout << count << endl;
  return 0;
}
Problem p02398 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;

int main() {
  int a, b, c, x;
  int y = 0;
  cin >> a >> b >> c;

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

  cout << y << endl;

  return 0;
}

Fixed submission:
#include <iostream>
using namespace std;

int main() {
  int a, b, c, x;
  int y = 0;
  cin >> a >> b >> c;

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

  cout << y << endl;

  return 0;
}
Problem p02398 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;
#define MAX 10000

int main(void) {
  int a, b, c, count;
  do {
    cin >> a >> b >> c;
  } while (a < 1 || a > MAX || b < 1 || b > MAX || c < 1 || c > MAX || a > b);

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

Fixed submission:
#include <iostream>
using namespace std;
#define MAX 10000

int main(void) {
  int a, b, c, count;
  do {
    cin >> a >> b >> c;
  } while (a < 1 || a > MAX || b < 1 || b > MAX || c < 1 || c > MAX || a > b);

  for (int i = a; i <= b; i++) {
    if (c % i == 0)
      count++;
  }
  cout << count << endl;
  return 0;
}
Problem p02398 (C++)

Buggy submission (status: 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 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 0;
}
Problem p02398 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;

int main() {

  int a, b, c, i, n;

  cin >> a >> b >> c;

  n = 0;

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

  cout << n << endl;
}

Fixed submission:
#include <iostream>
using namespace std;

int main() {

  int a, b, c, i, n;

  cin >> a >> b >> c;

  n = 0;

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

  cout << n << endl;
}
Problem p02398 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;
int main() {
  int a;
  int b;
  int c;
  int i;
  int x = 0;
  cin >> a >> b >> c;
  for (i = a; i++; i <= b) {
    if (c % i == 0) {
      x++;
    }
  }
  cout << x << endl;
  return 0;
}


Fixed submission:
#include <iostream>
using namespace std;
int main() {
  int a;
  int b;
  int c;
  int i;
  int x = 0;
  cin >> a >> b >> c;
  for (i = a; i <= b; i++) {
    if (c % i == 0) {
      x++;
    }
  }
  cout << x << endl;
  return 0;
}
Problem p02398 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <iostream>
using namespace std;

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

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

Fixed submission:
#include <algorithm>
#include <iostream>
using namespace std;

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

  for (a; a <= b; a++) {
    if (c % a == 0)
      n++;
  }
  cout << n << endl;
}
Problem p02398 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
using namespace std;

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

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


Fixed submission:
#include <iostream>
using namespace std;

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

  int cnt = 0;
  for (int i = a; i <= b; i++) {
    if (c % i == 0) {
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}
Problem p02399 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <iostream>

using namespace std;

int main() {
  long a, b;
  cin >> a >> b;
  long d = a / b;
  long r = a % b;

  cout << d << " " << r << " " << d << ".";
  for (int i = 0; i < 5; ++i) {
    int k = -1;
    while (r < b) {
      r *= 10;
      ++k;
    }
    long rr = r / b;
    r %= b;
    for (int j = 0; j < k; ++j)
      cout << 0;
    cout << rr;
  }
  cout << endl;
}


Fixed submission:
#include <algorithm>
#include <iostream>

using namespace std;

int main() {
  long a, b;
  cin >> a >> b;
  long d = a / b;
  long r = a % b;

  cout << d << " " << r << " " << d << ".";
  for (int i = 0; i < 5; ++i) {
    int k = -1;
    while (r != 0 && r < b) {
      r *= 10;
      ++k;
    }
    long rr = r / b;
    r %= b;
    for (int j = 0; j < k; ++j)
      cout << 0;
    cout << rr;
  }
  cout << endl;
}
Problem p02399 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  cout << fixed << setprecision(12);
  int a, b;
  cin >> a, b;
  cout << a / b << " " << a % b << " " << (double)a / b << endl;
  return 0;
}


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

int main() {
  cout << fixed << setprecision(12);
  int a, b;
  cin >> a >> b;
  cout << a / b << " " << a % b << " " << (double)a / b << endl;
  return 0;
}
Problem p02399 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cctype>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>

using namespace std;

int main() {
  int a, b;
  int d = a / b;
  int r = a % b;
  double f = 1.0 * a / b;
  printf("%d %d %.5lf\n", d, r, f);
  // while(1);
  return 0;
}


Fixed submission:
#include <algorithm>
#include <cctype>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>

using namespace std;

int main() {
  int a, b;
  cin >> a >> b;
  int d = a / b;
  int r = a % b;
  double f = 1.0 * a / b;
  printf("%d %d %.5lf\n", d, r, f);
  // while(1);
  return 0;
}
Problem p02399 (C++)

Buggy submission (status: Runtime Error):
#include <cstdio>

int main() {
  float a, b;
  scanf("%lf%lf", &a, &b);
  printf("%d %d %lf\n", (int)(a / b), (int)a % (int)b, a / b);
  return 0;
}

Fixed submission:
#include <cstdio>

int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  printf("%d %d %lf\n", a / b, a % b, (double)a / b);
  return 0;
}
Problem p02399 (C++)

Buggy submission (status: Runtime Error):
// Tuvshee

#include <algorithm>
#include <cctype>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
#define I int
#define D double
#define F float
#define C char
#define S string
#define B bool
#define L long long
#define rep(n) for (int i = 0; i < n; i++)
#define reps(m, n, c) for (int c = m; c < n; c++)
#define repd(m, n, j) for (int j = n; j > m; j--)
#define whL while
#define eL endl
#define oR ||
#define anD &&
#define rtn return
#define pause system("PAUSE")
#define Max 300
#define max(m, n) ((n < m) ? m : n)
#define min(m, n) ((n > m) ? m : n)

int main() {
  I m, n;
  cin >> m >> n;
  cout << m / n << ' ' << m % n << ' ' << setprecision(5) << fixed
       << double(m) / n << eL;
  pause;
  rtn 0;
}

Fixed submission:
// Tuvshee

#include <algorithm>
#include <cctype>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
#define I int
#define D double
#define F float
#define C char
#define S string
#define B bool
#define L long long
#define rep(n) for (int i = 0; i < n; i++)
#define reps(m, n, c) for (int c = m; c < n; c++)
#define repd(m, n, j) for (int j = n; j > m; j--)
#define whL while
#define eL endl
#define oR ||
#define anD &&
#define rtn return
#define pause system("PAUSE")
#define Max 300
#define max(m, n) ((n < m) ? m : n)
#define min(m, n) ((n > m) ? m : n)

int main() {
  I m, n;
  cin >> m >> n;
  cout << m / n << ' ' << m % n << ' ' << setprecision(5) << fixed
       << double(m) / n << eL;
  rtn 0;
}
Problem p02399 (C++)

Buggy submission (status: Runtime Error):
#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);
}

Fixed submission:
#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);
}
Problem p02399 (C++)

Buggy submission (status: 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;
}


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 (status: Runtime Error):
#include <cstdio>

using namespace std;

int main(void) {
  int a, b;

  scanf("%d%d", a, b);
  printf("%d %d %.5f", a / b, a % b, (double)a / (double)b);

  return 0;
}

Fixed submission:
#include <cstdio>

using namespace std;

int main(void) {
  int a, b;

  scanf("%d%d", &a, &b);
  printf("%d %d %.5f", a / b, a % b, (double)a / (double)b);

  return 0;
}
Problem p02399 (C++)

Buggy submission (status: Runtime Error):
#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;
}

Fixed submission:
#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;
}
Problem p02399 (C++)

Buggy submission (status: Runtime Error):
#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;
}


Fixed submission:
#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;
}
Problem p02399 (C++)

Buggy submission (status: Runtime Error):
#include <iomanip>
#include <iostream>

using namespace std;

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

  cout << a / b << " " << a % b << " " << setprecision(10) << ((double)a) / b
       << endl;
  system("pause");
  return 0;
}

Fixed submission:
#include <iomanip>
#include <iostream>

using namespace std;

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

  cout << a / b << " " << a % b << " " << setiosflags(ios::fixed)
       << setprecision(10) << ((double)a) / b << endl;

  return 0;
}
Problem p02399 (C++)

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

Fixed submission:
#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;
}
Problem p02399 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main() {
  int a, b, c, d, r;
  double f;
  scanf("%d,%d", &a, &b);
  d = a / b;
  r = a % b;
  f = a % b;
  printf("%d %d %lf\n", d, r, f);
  return 0;
}

Fixed submission:
#include <stdio.h>
int main() {
  int a;
  int b;
  scanf("%d", &a);
  scanf("%d", &b);
  printf("%d %d %lf\n", a / b, a % b, a / (double)b);
  return 0;
}
Problem p02399 (C++)

Buggy submission (status: 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;
}


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 (status: Runtime Error):
#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;
}


Fixed submission:
#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;
}
Problem p02399 (C++)

Buggy submission (status: Runtime Error):
#include <iomanip>
#include <iostream>
using namespace std;

int main() {
  double a, b, df, r;
  df = a / b;
  r = (int)a % (int)b;
  cout << (int)df << " " << r << " " << fixed << setprecision(5) << df << endl;
  return 0;
}


Fixed submission:
#include <iomanip>
#include <iostream>
using namespace std;

int main() {
  double a, b, df, r;
  cin >> a >> b;
  df = a / b;
  r = (int)a % (int)b;
  cout << (int)df << " " << r << " " << fixed << setprecision(5) << df << endl;
  return 0;
}
Problem p02400 (Python)

Buggy submission (status: Runtime Error):
import math

r = int(input())
print(math.pi * r * r, 2 * math.pi * r)


Fixed submission:
import math

r = float(input())
print(math.pi * r * r, 2 * math.pi * r)
Problem p02400 (Python)

Buggy submission (status: Runtime Error):
Pi = 3.14159265
R = int(input())
M = 2 * R * Pi
E = R**2 * Pi
"""
print("{:.10}".format(M))
print("{:.10}".format(E))
"""
print(M)
print(E)


Fixed submission:
import math

r = float(input())
print("{} {}".format(r**2 * math.pi, r * 2 * math.pi))
Problem p02400 (Python)

Buggy submission (status: Runtime Error):
pi = 3.14159265359
r = int(input())

print(f"{r*r*pi:.6f} {2*r*pi:.6f}")


Fixed submission:
pi = 3.14159265359
r = float(input())

print(f"{r*r*pi:.6f} {2*r*pi:.6f}")
Problem p02400 (Python)

Buggy submission (status: Runtime Error):
import math

a = int(input())
print(
    str("{0:.6f}".format((a * a) * math.pi))
    + " "
    + str("{0:.5f}".format((a + a) * math.pi))
)


Fixed submission:
import math

a = float(input())
print(
    str("{0:.6f}".format((a * a) * math.pi))
    + " "
    + str("{0:.5f}".format((a + a) * math.pi))
)
Problem p02400 (Python)

Buggy submission (status: Runtime Error):
import math

p = input()
r = int(p)
area = math.pi * r**2
length = 2 * math.pi * r
print(f"{area:.6f} {length:.6f}")


Fixed submission:
import math

r = float(input())
area = math.pi * r**2
length = 2 * math.pi * r
print(f"{area:.6f} {length:.6f}")
Problem p02400 (Python)

Buggy submission (status: Runtime Error):
r = int(input())
pi = 3.141592653589793238
print(pi * r * r, 2 * pi * r)


Fixed submission:
r = float(input())
pi = 3.1415926535897932384626
print(pi * r * r, 2 * pi * r)
Problem p02400 (Python)

Buggy submission (status: Runtime Error):
import math

r = int(input())
print(f"{r**2*math.pi:.8f}")


Fixed submission:
import math

r = float(input())
print(f"{r**2*math.pi:.8f} {math.pi*r*2:.8f}")
Problem p02400 (Python)

Buggy submission (status: Runtime Error):
pi = 3.141592653589793

r = int(input())
print("%.6f %.6f" % (pi * r**2, 2 * pi * r))


Fixed submission:
pi = 3.141592653589793

r = float(input())
print("%.6f %.6f" % (pi * r**2, 2 * pi * r))
Problem p02400 (Python)

Buggy submission (status: Runtime Error):
r = int(input())
pi = 3.141592653589
print("{:.10f} {:.10f}".format(r**2 * pi, 2 * r * pi))


Fixed submission:
r = float(input())
pi = 3.141592653589
print("{:.10f} {:.10f}".format(r**2 * pi, 2 * r * pi))
Problem p02400 (C++)

Buggy submission (status: Runtime Error):
#include <iomanip>
#include <iostream>
using namespace std;

int main() {
  int a, b, d;
  cin >> a >> b;
  d = a / b;
  cout << d << " " << a - b * d << " " << fixed << setprecision(5)
       << (double)a / b << endl;
  return 0;
}

Fixed submission:
#include <iomanip>
#include <iostream>
using namespace std;

int main() {
  double pi = 3.141592653589793;
  double r, pir;
  cin >> r;
  pir = pi * r;
  cout << fixed << setprecision(5) << pir * r << " " << pir * 2 << endl;
  return 0;
}
Problem p02400 (Python)

Buggy submission (status: Runtime Error):
r = int(input())
pi = 3.141592653589793
area = pi * r * r
circum = 2 * pi * r
print(str("{0:.6f}".format(area)) + " " + str("{0:.6f}".format(circum)))


Fixed submission:
import math

r = float(input())

area = math.pi * r * r
circum = 2 * math.pi * r
print(str("{0:.6f}".format(area)) + " " + str("{0:.6f}".format(circum)))
Problem p02400 (C++)

Buggy submission (status: Runtime Error):
#include <cstdio>
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("%d %d %lf\n", a / b, a % b, (double)a / b);
  return 0;
}

Fixed submission:
#include <cstdio>
int main() {
  double r, pi = 3.141592653589;
  scanf("%lf", &r);
  printf("%lf %lf\n", r * r * pi, 2 * r * pi);
  return 0;
}
Problem p02400 (C++)

Buggy submission (status: Runtime Error):
#include <cassert>
#include <cmath>
#include <iostream>
// #define NDEBUG
int main(void) {
  using namespace std;
  static const int INPUT_R_MAX = 10000;
  static const int INPUT_R_MIN = 1;
  double input_r = 0;
  double area = 0;          /* 面積 */
  double circumference = 0; /* 円周 */

  cin >> input_r; /* 半径 */

  /* 入力値の前提条件 */
  assert(INPUT_R_MIN <= input_r && input_r <= INPUT_R_MAX);

  /* Calculation */
  area = input_r * input_r * M_PI;
  circumference = input_r * 2 * M_PI;

  /* Output */
  cout << fixed << area << " " << circumference << endl;
  return 0;
}


Fixed submission:
#include <cassert>
#include <cmath>
#include <iostream>
// #define NDEBUG
int main(void) {
  using namespace std;
  static const int INPUT_R_MAX = 10000;
  static const int INPUT_R_MIN = 0;
  double input_r = 0;
  double area = 0;          /* 面積 */
  double circumference = 0; /* 円周 */

  cin >> input_r; /* 半径 */

  /* 入力値の前提条件 */
  assert(INPUT_R_MIN <= input_r && input_r <= INPUT_R_MAX);

  /* Calculation */
  area = input_r * input_r * M_PI;
  circumference = input_r * 2 * M_PI;

  /* Output */
  cout << fixed << area << " " << circumference << endl;
  return 0;
}
Problem p02400 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main() {
  cout << fixed << setprecision(12);
  int a, b;
  cin >> a >> b;
  cout << a / b << " " << a % b << " " << (double)a / b << endl;

  return 0;
}


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

int main() {
  cout << fixed << setprecision(6);
  double a;
  cin >> a;
  cout << a * a * acos(-1) << " " << 2 * a * acos(-1) << endl;

  return 0;
}
Problem p02400 (Python)

Buggy submission (status: Runtime Error):
import math

r = input()
print(r**2 * math.pi, r * 2 * math.pi)


Fixed submission:
import math

r = float(input())
print(float(r**2 * math.pi), float(r * 2 * math.pi))
Problem p02400 (Python)

Buggy submission (status: Runtime Error):
from math import pi

r = int(input())
print(r**2 * pi, 2 * r * pi)


Fixed submission:
from math import pi

r = float(input())
print(r**2 * pi, 2 * r * pi)
Problem p02400 (Python)

Buggy submission (status: Runtime Error):
import math

r = int(input())

print(f"{math.pi * r ** 2} {2 * math.pi * r}")


Fixed submission:
import math

r = float(input())

print(f"{math.pi * r ** 2} {2 * math.pi * r}")
Problem p02400 (Python)

Buggy submission (status: Runtime Error):
r = int(input())
print(r * r * 3.14159265359, 2 * r * 3.14159265359)


Fixed submission:
r = float(input())
print("{:.6f} {:.6f}".format(r * r * 3.14159265359, 2 * r * 3.14159265359))
Problem p02400 (C++)

Buggy submission (status: Runtime Error):
#include <stdio.h>
int main() {
  int a, b, d = 0, r = 0;
  double f = 0.0;
  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;
}

Fixed submission:
#include <stdio.h>
int main() {
  double r;
  double S = 0.0, L = 0.0, pi = 3.14159265359;
  scanf("%lf", &r);
  S = r * r * pi;
  L = 2 * r * pi;
  printf("%.6lf %.6lf\n", S, L);
  return 0;
}
Problem p02400 (Python)

Buggy submission (status: Runtime Error):
import math

r = int(input())
print(round(r**2 * math.pi, 6), round(r * 2 * math.pi, 6))


Fixed submission:
import math

r = float(input())
print(round(r**2 * math.pi, 6), round(r * 2 * math.pi, 6))
Problem p02400 (Python)

Buggy submission (status: Runtime Error):
from math import pi

r = int(input())

# 面積
circle_area = r * r * pi
# 円周
circumference = 2.0 * r * pi

print("{} {}".format(circle_area, circumference))


Fixed submission:
from math import pi

r = float(input())
print("{} {}".format(r * r * pi, 2 * pi * r))
Problem p02400 (Python)

Buggy submission (status: Runtime Error):
r = int(input())
pi = 3.141592653589793
A = float(pow(r, 2) * pi)
S = float(2 * pi * r)
print("{0:.8f}".format(A) + " " + "{0:.8f}".format(S))


Fixed submission:
r = float(input())
pi = 3.141592653589793
A = float(pow(r, 2) * pi)
S = float(2 * pi * r)
print("{0:.8f}".format(A) + " " + "{0:.8f}".format(S))
Problem p02401 (C++)

Buggy submission (status: Runtime Error):
#include <iostream>
using namespace std;

int main() {

  int a, b, c, d, e, f;
  char op;
  while (true) {
    cin >> a >> op >> b;
    if (op == '?')
      break;
    c = a + b;
    d = a - b;
    e = a * b;
    f = a / b;

    if (op == '+')
      cout << c << "\n";
    if (op == '-')
      cout << d << "\n";
    if (op == '*')
      cout << e << "\n";
    if (op == '/')
      cout << f << "\n";
  }
}

Fixed submission:
#include <iostream>
using namespace std;

int main() {

  int a, b, c, d, e, f;
  char op;
  while (true) {
    cin >> a >> op >> b;
    if (op == '?')
      break;
    c = a + b;
    d = a - b;
    e = a * b;
    if (b != 0)
      f = a / b;

    if (op == '+')
      cout << c << "\n";
    if (op == '-')
      cout << d << "\n";
    if (op == '*')
      cout << e << "\n";
    if (op == '/')
      cout << f << "\n";
  }
}