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

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

int main() {
  string x;
  cin >> x;
  char X;
  X = x.at(8);

  cout << 'A' << X << 'C' << endl;
}


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

int main() {
  string a, b, c;
  cin >> a >> b >> c;
  cout << 'A' << b.at(0) << 'C' << endl;
  return 0;
}
Problem p03860 (C++)

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

int main() {
  string A, s, C;
  cin >> A >> s >> C;
  cout << "A" << s.at(1) << "C" << endl;
}

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

int main() {
  string A, s, C;
  cin >> A >> s >> C;
  cout << "A" << s.at(0) << "C" << endl;
}
Problem p03860 (C++)

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

int main() {
  int n;
  cin >> n;
  ll x;
  cin >> x;
  ll ans = 0;
  vector<ll> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (a[0] > x) {
    ans += a[0] - x;
    a[0] -= a[0] - x;
  }
  for (int i = 1; i < n; i++) {
    if (a[i - 1] + a[i] > x) {
      ans += a[i - 1] + a[i] - x;
      a[i] -= a[i - 1] + a[i] - x;
    }
  }
  cout << ans << endl;
}

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

int main() {
  string a, b, c;
  cin >> a >> b >> c;
  cout << a[0] << b[0] << c[0] << endl;
}
Problem p03860 (C++)

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

int main() {
  string s;
  cin >> s;

  cout << 'A' << s.at(8) << 'C' << endl;
}

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

int main() {
  string s;
  getline(cin, s);

  cout << 'A' << s.at(8) << 'C' << endl;
}
Problem p03860 (C++)

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

int main() {
  string a, b, c;
  cout << a.at(0) << b.at(0) << c.at(0) << endl;
}

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

int main() {
  string a, b, c;
  cin >> a >> b >> c;
  cout << a.at(0) << b.at(0) << c.at(0) << endl;
}
Problem p03860 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 1; i <= n; ++i)
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
using namespace std;

int main() {
  string a, b, c;
  cout << a << b << c;
  cout << "A" << b.at(0) << "C" << endl;
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 1; i <= n; ++i)
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
using namespace std;

int main() {
  string a, b, c;
  cin >> a >> b >> c;
  cout << "A" << b.at(0) << "C" << endl;
  return 0;
}
Problem p03860 (C++)

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

int main() {
  string s, t, u;
  cin >> s >> t >> u;

  cout << s.at(1) + t.at(1) + u.at(1) << endl;
}


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

int main() {
  string s, t, u;
  cin >> s >> t >> u;

  cout << s.at(0) << t.at(0) << u.at(0) << endl;
}
Problem p03860 (C++)

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

int main() {
  string S;
  cin >> S;
  char x = S.at(7);
  cout << 'A' << x << 'C' << endl;

  return 0;
}


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

int main() {
  string A, B, C;
  cin >> A >> B >> C;
  cout << A.at(0) << B.at(0) << C[0] << endl;
}
Problem p03860 (C++)

Buggy submission (status: Runtime Error):
#include <cstdio>
int main() {
  char a[100], x[100], c[100];
  scanf("%s %s %s", a, x, c);

  printf("%s%s%s", a[0], x[0], c[0]);

  return 0;
}


Fixed submission:
#include <cstdio>
int main() {
  char a[100], x[100], c[100];
  scanf("%s %s %s", a, x, c);

  printf("%c%c%c", a[0], x[0], c[0]);

  return 0;
}
Problem p03860 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define rep(i, m, n) for (int i = m; i < n; i++)
#define co(n) cout << n << endl
using namespace std;
int main() {
  string s;
  cout << "A" << s.at(0) << "C" << endl;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#define rep(i, m, n) for (int i = m; i < n; i++)
#define co(n) cout << n << endl
using namespace std;
int main() {
  string a, s, c;
  cin >> a >> s;
  cout << "A" << s.at(0) << "C" << endl;
  return 0;
}
Problem p03860 (C++)

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

int main() {
  string AtCoder, s, Contest;
  cin >> s;
  char A = AtCoder.at(0), S = s.at(0), C = Contest.at(0);
  cout << A << S << C << endl;
}


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

int main() {
  string a, b, c;
  cin >> a >> b >> c;
  cout << a.at(0) << b.at(0) << c.at(0) << endl;
}
Problem p03860 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  char x;
  x = s.at(7);
  cout << "A" << x << "C" << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b, c;
  cin >> a >> b >> c;

  cout << a.at(0) << b.at(0) << c.at(0) << endl;
}
Problem p03860 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;

int main() {
  string s;
  cin >> s;
  cout << s.at(9) << endl;
}


Fixed submission:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;

int main() {
  string s, t;
  cin >> s >> t;
  cout << "A" << t.at(0) << "C" << endl;
}
Problem p03860 (C++)

Buggy submission (status: Runtime Error):

#include <iostream>
using namespace std;

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

  cout << A.at(1) << B.at(1) << C.at(1) << endl;
}


Fixed submission:

#include <iostream>
using namespace std;

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

  cout << A.at(0) << B.at(0) << C.at(0) << endl;
}
Problem p03860 (C++)

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

string s;

int main() {
  cin >> s;
  cout << 'A' << s.at(8) << 'C' << endl;
  return 0;
}


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

string s;

int main() {
  getline(cin, s);
  cout << 'A' << s.at(8) << 'C' << endl;
  return 0;
}
Problem p03860 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>

using namespace std;

typedef long long int lld;

const lld mod = 1e9 + 7;
const lld INF = 1e9;
// const lld MAXN = 1e9;

int main() {
  string s[3];

  cin >> s[0] >> s[1] >> s[3];

  cout << s[1][0] << endl;

  return 0;
}

Fixed submission:
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>

using namespace std;

typedef long long int lld;

const lld mod = 1e9 + 7;
const lld INF = 1e9;
// const lld MAXN = 1e9;

int main() {
  string s[3];
  cin >> s[0] >> s[1] >> s[2];
  cout << s[0][0] << s[1][0] << s[2][0] << endl;

  return 0;
}
Problem p03860 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;

  cout << s1.at(0) << s2.at(1) << s3.at(2) << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;

  cout << s1.at(0) << s2.at(0) << s3.at(0) << endl;
}
Problem p03860 (C++)

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

int main() {
  string a, s, c;
  cin >> a, s, c;
  cout << a.at(0) << s.at(0) << c.at(0) << endl;
}


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

int main() {
  string a, s, c;
  cin >> a >> s >> c;
  cout << a.at(0) << s.at(0) << c.at(0) << endl;
}
Problem p03860 (C++)

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

int main() {
  string s, t, l;
  cin >> s >> t >> l;
  cout << s.at(1) << t.at(1) << l.at(1) << endl;
}


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

int main() {
  string s, t, l;
  cin >> s >> t >> l;
  cout << s.at(0) << t.at(0) << l.at(0) << endl;
}
Problem p03860 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  string n;
  cin >> n;
  char a = n.at(8);

  cout << "A" << a << "C" << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  string n, s;
  cin >> n >> s;
  char a = s.at(0);

  cout << "A" << a << "C" << endl;
}
Problem p03860 (C++)

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

int main() {
  string s, t, u;
  cin >> s;

  cout << "A" << t.at(0) << "C" << endl;
}

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

int main() {
  string s, t, u;
  cin >> s >> t >> u;

  cout << "A" << t.at(0) << "C" << endl;
}
Problem p03860 (C++)

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

int main() {
  char F;
  string A, S;
  A = "A";

  cin >> S;
  F = S.at(7);
  A = A + F + "C";

  cout << A << endl;
}

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

int main() {
  char F;
  string A, S;
  A = "A";

  getline(cin, S);
  F = S.at(8);
  A = A + F + "C";

  cout << A << endl;
}
Problem p03860 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[3];
  for (char i = 0; i < 3; i++) {
    scanf("%s", &a[i]);
    printf("%c", a[i]);
  }
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[100];
  char c[100], v[100];
  cin >> c >> s >> v;
  if (c[0] >= 'a' && c[0] <= 'z')
    c[0] -= 32;
  if (s[0] >= 'a' && s[0] <= 'z')
    s[0] -= 32;
  if (v[0] >= 'a' && v[0] <= 'z')
    v[0] -= 32;
  cout << c[0] << s[0] << v[0];

  return 0;
}
Problem p03860 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, x, c = 0;
  scanf("%lld%lld%lld", &a, &b, &x);
  for (a; a <= b; a++) {
    if (a % x == 0)
      c++;
  }
  printf("%lld", c);
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  string m;
  char f[7], l[7];
  cin >> f >> m >> l;
  f[0] = 'A';
  char ch = m[0];
  l[0] = 'C';
  printf("%c%c%c", f[0], ch, l[0]);
  return 0;
}
Problem p03860 (C++)

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

int main() {
  string s;
  cin >> s;
  cout << "A" << s.at(7) << "C" << endl;
}


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

int main() {
  string s;
  getline(cin, s);
  cout << "A" << s.at(8) << "C" << endl;
}
Problem p03860 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  char c;

  cin >> str;
  c = str.at(8);

  cout << "A" << c << 'C' << endl;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  string A, B, C;
  cin >> A >> B >> C;
  cout << A.at(0) << B.at(0) << C.at(0) << endl;
}
Problem p03860 (C++)

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

int main() {
  string s;
  cin >> s;
  cout << 'A' << s.at(8) << 'C' << endl;
}


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

int main() {
  string s1, s2;
  cin >> s1 >> s2;
  cout << 'A' << s2.at(0) << 'C' << endl;
}
Problem p03860 (C++)

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

using namespace std;

int main() {

  unsigned long N, x;
  cin >> N >> x;

  unsigned long a[N];

  for (int i = 0; i < N; i++)
    cin >> a[i];

  unsigned long sum = 0;
  if (a[0] > x) {
    a[0] -= a[0] - x;
    sum += a[0] - x;
  }
  for (int j = 0; j < N - 1; j++) {
    while (a[j] + a[j + 1] > x) {
      a[j + 1] -= a[j] + a[j + 1] - x;
      sum += a[j] + a[j + 1] - x;
    }
  }

  cout << sum << "\n";
}

Fixed submission:
#include <iostream>

using namespace std;

int main() {
  char a[10], s[100], b[10];
  cin >> a >> s >> b;
  cout << a[0] << s[0] << b[0];
}
Problem p03860 (C++)

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

int main() {
  string S1, S2, S3;
  cin >> S1, S2, S3;

  // ここにプログラムを追記
  cout << "A" << S2.at(0) << "C" << endl;
}


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

int main() {
  string S1, S2, S3;
  cin >> S1 >> S2 >> S3;

  // ここにプログラムを追記
  cout << "A" << S2.at(0) << "C" << endl;
}
Problem p03860 (C++)

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

int main() {

  string A, a, C;
  cin >> A, a, C;

  cout << "A" << a.at(0) << "C" << endl;
}


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

int main() {

  string A, a, C;
  cin >> A >> a >> C;

  cout << "A" << a.at(0) << "C" << endl;
}
Problem p03860 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  string word;
  for (int i = 0; i < 3; i++) {
    cout << word.at(0);
  }
  cout << endl;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  string word;
  for (int i = 0; i < 3; i++) {
    cin >> word;
    cout << word.at(0);
  }
  cout << endl;
  return 0;
}
Problem p03860 (C++)

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

int main() {
  string S, T;
  cin >> S >> T;
  cout << "A" << T.at(8) << "C" << endl;
}


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

int main() {
  string S, T;
  cin >> S >> T;
  cout << "A" << T.at(0) << "C" << endl;
}
Problem p03860 (C++)

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

int main() {
  string a, b, c;
  cin >> a >> b >> c;
  cout << a.at(1) + b.at(1) + c.at(1) << endl;
}


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

int main() {
  string a, b, c;
  cin >> a >> b >> c;
  cout << a.at(0) << b.at(0) << c.at(0) << endl;
}
Problem p03860 (C++)

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

int main() {
  string s;

  char x = s.at(0);
  cout << "A" << x << "C" << endl;
}

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

int main() {
  string a, s, c;
  cin >> a >> s >> c;
  char x = a.at(0);
  char y = s.at(0);
  char z = c.at(0);
  cout << x << y << z << endl;
}
Problem p03860 (C++)

Buggy submission (status: Time Limit Exceeded):
// 水到家了
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
  char a[100], b[100], c[100];
  ios::sync_with_stdio(false);
  while (1) {
    scanf("%s%s%s", a, b, c);
    cout << a[0] << b[0] << c[0];
  }
}

Fixed submission:
// 水到家了
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
  char a[100], b[100], c[100];
  ios::sync_with_stdio(false);
  scanf("%s%s%s", a, b, c);
  cout << a[0] << b[0] << c[0];
}
Problem p03860 (C++)

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

int main() {
  string a, x;
  cin >> a >> x;
  cout << 'A' << x.at(1) << 'C' << endl;
}


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

int main() {
  string a, x;
  cin >> a >> x;
  cout << 'A' << x.at(0) << 'C' << endl;
}
Problem p03860 (C++)

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

int main() {
  string s;
  cin >> s;
  char x = s.at(7);
  cout << "A" << x << "C";
}

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

int main() {
  string s;
  getline(cin, s);
  cout << "A" << s.at(8) << "C";
}
Problem p03860 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  cout << 'A' << s.at(8) << 'C' << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, s;
  cin >> a >> s;
  cout << 'A' << s.at(0) << 'C' << endl;
}
Problem p03860 (C++)

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

int main() {
  string s;
  cin >> s;
  cout << "A" << s.at(8) << "C" << endl;
}

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

int main() {
  string a, b, c;
  cin >> a >> b >> c;
  cout << "A" << b.at(0) << "C" << endl;
}
Problem p03860 (C++)

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

int main() {
  string c;
  cin >> c;
  cout << "A" << c.at(8) << "C" << endl;
}


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

int main() {
  string a, b, c;
  cin >> a >> b >> c;
  cout << a.at(0) << b.at(0) << c.at(0) << endl;
}
Problem p03860 (C++)

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

int main() {
  string s;
  cin >> s;
  cout << 'A' << s.at(7) << 'C' << endl;
}

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

int main() {
  string s1, s2, s;
  cin >> s1 >> s >> s2;
  cout << 'A' << s.at(0) << 'C' << endl;
}
Problem p03860 (C++)

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

int main() {
  string a, b, c;
  cin >> a, b, c;
  cout << "A" << b.at(0) << "C" << endl;
}

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

int main() {
  string a, b, c;
  cin >> a >> b >> c;
  cout << "A" << b.at(0) << "C" << endl;
}
Problem p03860 (C++)

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

int main() {
  string S;
  char s;
  cin >> S;
  s = S.at(8);
  cout << "A" << s << "C" << endl;
}

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

int main() {
  string S;
  char s;
  cin >> S >> S;
  s = S.at(0);
  cout << "A" << s << "C" << endl;
}
Problem p03860 (C++)

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

int main() {
  string at;
  cin >> at;
  cout << "A" << at.at(7) << "C" << endl;
}

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

int main() {

  string s0, s1, s2;
  cin >> s0 >> s1 >> s2;
  cout << s0.at(0) << s1.at(0) << s2.at(0) << endl;
}
Problem p03860 (C++)

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

int main() {
  string s, t, u;
  cin >> s >> t >> u;

  cout << s.at(1) << t.at(1) << u.at(1) << endl;
}


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

int main() {
  string s, t, u;
  cin >> s >> t >> u;

  cout << s.at(0) << t.at(0) << u.at(0) << endl;
}
Problem p03860 (C++)

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

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

  cout << a.at(1) << b.at(1) << c.at(1) << endl;
}


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

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

  cout << a.at(0) << b.at(0) << c.at(0) << endl;
}
Problem p03860 (C++)

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

int main() {
  string s;
  cin >> s;
  char c = s.at(7);
  cout << "A" << c << "C" << endl;

  // ここにプログラムを追記
}

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

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

  cout << a.at(0) << b.at(0) << c.at(0) << endl;

  // ここにプログラムを追記
}
Problem p03860 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <iostream>
#include <string.h>
using namespace std;
int main() {
  char c;
  int flag = 1;
  while (scanf("%c", &c) && c != EOF) {
    if (flag == 1) {
      cout << c;
      flag = 0;
    }
    if (c == ' ')
      flag = 1;
  }
  cout << endl;
}

Fixed submission:
#include <iostream>
#include <string.h>
using namespace std;
int main() {
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  cout << "A" << s2[0] << "C" << endl;
  ;
}
Problem p03860 (C++)

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

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

  cout << a.at(0) << b.at(0) << c.at(0) << endl;
}


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

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

  cout << a.at(0) << b.at(0) << c.at(0) << endl;
}
Problem p03860 (C++)

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

int main() {
  string a, s, c;
  cin >> a, s, c;
  cout << "A" << s.at(0) << "C" << endl;
}


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

int main() {
  string s;
  getline(cin, s);
  cout << "A" << s.at(8) << "C" << endl;
}
Problem p03860 (C++)

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

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

  cout << a.at(0) << b.at(0) << c.at(0) << endl;
}

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

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

  cout << a.at(0) << b.at(0) << c.at(0) << endl;
}
Problem p03860 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
#include <iostream>

using namespace std;

int main() {
  long long int a, b, x;
  cin >> a >> b >> x;
  long long int t = a % x;
  long long xd = b - a + 1;
  long long int res = xd / x;
  long long int left = xd - res * x;
  if (left > 0) {
    if (t == 0)
      res++;
    else {
      if (t + left - 1 >= x)
        res++;
    }
  }
  cout << res;
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
#include <iostream>

using namespace std;

int main() {
  string a, b, c;
  cin >> a >> b >> c;
  cout << a[0] << b[0] << c[0];
  return 0;
}
Problem p03860 (C++)

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

int main() {
  string x, y, z;
  cin >> x >> y >> z;
  cout << x.at(1) << y.at(1) << z.at(1) << endl;
}


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

int main() {
  string x, y, z;
  cin >> x >> y >> z;
  cout << x.at(0) << y.at(0) << z.at(0) << endl;
}
Problem p03860 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  char a = 'A', c = 'C';
  string s;
  cin >> s;
  cout << a << s.at(9) << c << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  char a = 'A', c = 'C';
  string s, t, r;
  cin >> s >> t >> r;
  cout << a << t.at(0) << c << endl;
}
Problem p03860 (C++)

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

int main() {
  string c;
  cin >> c;
  cout << 'A' << c.at(9) << 'C' << endl;
}


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

int main() {
  string a, b, c;
  cin >> a >> b >> c;
  cout << a[0] << b[0] << c[0] << endl;
}
Problem p03860 (C++)

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

int main() {
  string str1, str2, str3;
  cin >> str1 >> str2 >> str3;

  cout << str1.at(1) << str2.at(2) << str3.at(3) << endl;
}


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

int main() {
  string str1, str2, str3;
  cin >> str1 >> str2 >> str3;

  cout << str1.at(0) << str2.at(0) << str3.at(0) << endl;
}
Problem p03860 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, t, u;
  cin >> s, t, u;
  char v = t.at(0);
  cout << 'A' << v << 'C' << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, t, u;
  cin >> s >> t >> u;
  char v = t.at(0);
  cout << 'A' << v << 'C' << endl;
}
Problem p03860 (C++)

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

int main() {
  int N = 3;
  for (int i = 0; i < N; i++) {
    string s;
    cin >> s;
    if (i = 1) {
      char x = s.at(0);
      cout << 'A' << x << 'C' << endl;
    }
  }
}


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

int main() {
  int N = 3;
  for (int i = 0; i < N; i++) {
    string s;
    cin >> s;
    if (i == 1) {
      char x = s.at(0);
      cout << 'A' << x << 'C' << endl;
    }
  }
}
Problem p03860 (C++)

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

int main() {
  string s;
  cin >> s;
  cout << "A" << s.at(8) << "C" << endl;
}

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

int main() {
  string s;
  getline(cin, s);
  cout << "A" << s.at(8) << "C" << endl;
}
Problem p03860 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  cout << 'A' << S.at(8) << 'C' << endl;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  string A, S, C;
  cin >> A >> S >> C;
  cout << 'A' << S.at(0) << 'C' << endl;
}
Problem p03860 (C++)

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

int main() {
  int numberOfWords;
  string words[numberOfWords];
  for (int i = 0; i < numberOfWords; ++i) {
    cin >> words[i];
  }
  char initisls[numberOfWords];
  for (int i = 0; i < 3; ++i) {
    initisls[i] = words[i].front();
  }
  cout << initisls << endl;
}


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

int main() {
  static const int numberOfWords = 3;
  string words[numberOfWords];
  for (int i = 0; i < numberOfWords; ++i) {
    cin >> words[i];
  }
  char initisls[numberOfWords];
  for (int i = 0; i < 3; ++i) {
    initisls[i] = words[i].front();
  }
  cout << initisls << endl;
}
Problem p03860 (C++)

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

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

  cout << a << b.at(7) << c << endl;
}

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

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

  cout << a.at(0) << b.at(0) << c.at(0) << endl;
}
Problem p03860 (C++)

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

int main() {
  string S;
  cin >> S;
  S = 'A' + S.at(8) + 'C';
  cout << S << endl;
}


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

int main() {
  string S;
  cin >> S >> S;
  cout << 'A' << S.at(0) << 'C' << endl;
}
Problem p03860 (C++)

Buggy submission (status: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  cout << "A" << s.at(8) << "C";
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  getline(cin, s);
  cout << "A" << s.at(8) << "C";
}
Problem p03861 (C++)

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

int main() {
  int16_t a, b, x;
  cin >> a >> b >> x;
  if (a == 0)
    cout << b / x + 1 << endl;
  else
    cout << b / x - (a - 1) / x << endl;
}

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

int main() {
  int64_t a, b, x;
  cin >> a >> b >> x;
  if (a == 0)
    cout << b / x + 1 << endl;
  else
    cout << b / x - (a - 1) / x << endl;
}
Problem p03861 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
#define cinf(n, x)                                                             \
  for (int i = 0; i < (n); i++)                                                \
    cin >> x[i];
typedef long long int ll;
using namespace std;

int main() {
  ll a, b, x;
  cin >> a >> b >> x;
  ll ans = 0;
  ll memo = 100000000000;
  for (ll i = a; i <= b; i++) {
    if (i % x == 0) {
      ans++;
      memo = i;
      break;
    }
  }
  for (ll i = memo; i + x <= b; i += x) {
    ans++;
  }
  cout << ans << endl;
}

Fixed submission:
#include <bits/stdc++.h>
#define cinf(n, x)                                                             \
  for (int i = 0; i < (n); i++)                                                \
    cin >> x[i];
typedef long long int ll;
using namespace std;

int main() {
  ll a, b, x;
  cin >> a >> b >> x;
  cout << b / x + 1 - (a > 0 ? (a - 1) / x + 1 : 0) << endl;
}
Problem p03861 (Python)

Buggy submission (status: Time Limit Exceeded):
a, b, x = map(int, input().split())
cnt = 0
for i in range(a, b + 1):
    if i % x == 0:
        cnt += 1
print(cnt)


Fixed submission:
a, b, x = map(int, input().split())
zenbu = b // x + 1
tmp = 0
if a % x == 0:
    tmp += 1
bubun = a // x + 1
ans = zenbu - bubun + tmp
print(ans)
Problem p03861 (Python)

Buggy submission (status: Time Limit Exceeded):
a, b, x = map(int, input().split())
int_list = [i for i in range(a, b + 1)]
counter = 0
for i in range(len(int_list)):
    if int_list[i] % x == 0:
        counter += 1

print(counter)


Fixed submission:
a, b, x = map(int, input().split())
print(b // x - (a - 1) // x)
Problem p03861 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;

int main() {
  ll a, b, x;
  cin >> a >> b >> x;
  for (ll i = a;; i++) {
    if (i % x == 0) {
      a = i;
      break;
    }
  }
  for (ll i = b;; i--) {
    if (i % x == 0) {
      b = i;
      break;
    }
  }
  cout << (b - a) / x + 1 << endl;
  return 0;
}

Fixed submission:
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;

int main() {
  ll a, b, x;
  cin >> a >> b >> x;
  cout << (a > 0 ? b / x - (a - 1) / x : b / x + 1) << endl;
  return 0;
}
Problem p03861 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a;
  long long b;
  long long c;
  long long n = 0;
  cin >> a >> b >> c;
  for (int i = a; i <= b; i++) {
    if (i % c == 0)
      ++n;
  }
  cout << n;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a;
  long long b;
  long long c;
  long long n = 0;
  cin >> a >> b >> c;
  n = (b / c) - (a / c);
  if (a % c == 0)
    ++n;
  cout << n;
}
Problem p03861 (C++)

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


Fixed submission:
#include <iostream>
using namespace std;
int main() {
  long long a, b, c;
  cin >> a >> b >> c;
  long long ans;
  // long long  tmp = (a-1) % c ? 1 :0,tmp2 = b%c ? 1:0;
  if (a != 0)
    ans = b / c - (a - 1) / c;
  else
    ans = b / c + 1;
  cout << ans << endl;
}
Problem p03861 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <stdio.h>
int main() {
  unsigned long long a, b, x;
  scanf("%llu %llu %llu", &a, &b, &x);
  unsigned long long nCnt = 0;

  if (x == 0) {
    printf("0");
    return 0;
  }

  bool bFind = false;
  while (a <= b) {
    if (false == bFind) {
      unsigned long long z = a % x;
      if (0 == z) {
        bFind = true;
        nCnt++;
        a += x;
      } else {
        a++;
      }
    } else {
      nCnt++;
      a += x;
    }
  }
  printf("%llu", nCnt);
  return 0;
}


Fixed submission:
#include <stdio.h>
int main() {
  unsigned long long a, b, x;
  scanf("%llu %llu %llu", &a, &b, &x);
  unsigned long long nCnt = 0;

  if (x == 0) {
    printf("0");
    return 0;
  }

  unsigned long long nBigJ = b / x;
  unsigned long long nSmlJ = a / x;
  unsigned long long nSmlA = a % x;

  nCnt = nBigJ - nSmlJ;
  if (0 == nSmlA)
    nCnt++;
  printf("%llu", nCnt);
  return 0;
}
Problem p03861 (C++)

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

int main() {
  long long int a, b, x;
  cout << b / x - (a + x - 1) / x + 1 << endl;
}


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

int main() {
  long long int a, b, x;
  cin >> a >> b >> x;
  cout << b / x - (a + x - 1) / x + 1 << endl;
}
Problem p03861 (C++)

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

using namespace std;

int main() {

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

  if (a == 0) {
    cout << b / c + 1 << endl;
  } else {
    cout << (b / c) - ((a - 1) / c) << endl;
  }

  return 0;
}

Fixed submission:
#include <cmath>
#include <iostream>
#include <string>

using namespace std;

int main() {

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

  if (a == 0) {
    cout << b / c + 1 << endl;
  } else {
    cout << (b / c) - ((a - 1) / c) << endl;
  }

  return 0;
}
Problem p03861 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <cstring>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
using ll = long long;

int main() {
  ll a, b, x;
  ll ans;
  cin >> a >> b >> x;
  ans = (b - a + 1) / x;
  a += ans * x;
  for (ll i = a; i <= b; i++) {
    if (i % x == 0) {
      ans++;
      break;
    }
  }
  cout << ans << endl;
  return 0;
}

Fixed submission:
#include <algorithm>
#include <cstring>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
using ll = long long;

int main() {
  ll a, b, x;
  ll ans;
  cin >> a >> b >> x;
  ans = (b - a + 1) / x;
  a += ans * x;
  ll c = a % x;
  c = c == 0 ? x : c;
  if (a + x - c <= b) {
    ++ans;
  }
  cout << ans << endl;
  return 0;
}
Problem p03861 (C++)

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

int main() {
  ll a, b, x;
  cin >> a >> b >> x;
  ll s = -1, e = -1;
  // 小さいもの
  for (ll i = a; i <= b; i++) {
    if (i % x == 0) {
      s = i;
      break;
    }
  }
  if (s == -1) {
    cout << 0 << endl;
    return 0;
  }
  // 大きいもの
  for (ll i = b; i >= a; i--) {
    if (i % x == 0) {
      e = i;
      break;
    }
  }
  // 割り切れるものなし

  // 割り切れるものがある
  // cout<<"s : "<<s<<endl;
  // cout<<"e : "<<e<<endl;
  ll ans = (e - s) / x + 1;
  cout << ans << endl;
  return 0;
}

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

int main() {
  ll a, b, x;
  cin >> a >> b >> x;
  cout << b / x - a / x + !(a % x) << endl;
  return 0;
}
Problem p03861 (C++)

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

using namespace std;

int main(void) {
  long long a, b, X;
  cin >> a >> b >> X;

  long long ans = 0;
  for (int i = a; i < b + 1; i++) {
    if (i % X == 0) {
      ans++;
    }
  }

  cout << ans << endl;
  return 0;
}

Fixed submission:
#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <stdio.h>
#include <string>

using namespace std;

int main(void) {
  long long a, b, X;
  cin >> a >> b >> X;

  long long upper = b / X;
  long long lower = (a + X - 1) / X;
  cout << upper - lower + 1 << endl;
  return 0;
}
Problem p03861 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <stdio.h>
#include <string>

using namespace std;

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

  if (A != 0) {
    cout << (B / C + 1) - ((A - 1) / C + 1) << endl;
  } else {
    cout << (B / C + 1) << endl;
  }
  return 0;
}

Fixed submission:
#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <stdio.h>
#include <string>

using namespace std;

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

  if (A != 0) {
    cout << (B / C + 1) - ((A - 1) / C + 1) << endl;
  } else {
    cout << (B / C + 1) << endl;
  }
  return 0;
}
Problem p03861 (C++)

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

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

  if (a % x == 0) {
    cout << b / x - a / x + 1 << endl;
  } else {
    cout << b / x - a / x << endl;
  }
}


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

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

  if (a % x == 0) {
    cout << b / x - a / x + 1 << endl;
  } else {
    cout << b / x - a / x << endl;
  }
}
Problem p03861 (C++)

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

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


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

int main() {
  unsigned long long a, b, c, i = 0;
  cin >> a >> b >> c;
  i = (b / c) - (a / c);
  if (a % c == 0)
    i++;
  cout << i;
}
Problem p03861 (Python)

Buggy submission (status: Time Limit Exceeded):
a, b, x = map(int, input().split())
ans = 0

for i in range(a, b + 1):
    if i % x == 0:
        ans += 1
print(ans)


Fixed submission:
a, b, x = map(int, input().split())
print(b // x - (a - 1) // x)
Problem p03861 (Python)

Buggy submission (status: Time Limit Exceeded):
a, b, x = map(int, input().split())

ans = 0
for i in range(a, b + 1):
    if i % x == 0:
        ans += 1

print(ans)


Fixed submission:
a, b, x = map(int, input().split())


ans = b // x - (a - 1) // x


print(ans)
Problem p03861 (Python)

Buggy submission (status: Runtime Error):
a, b, x = map(int, input().split())

if x % a == 0:
    print((b - a + 1) // x + 1)
else:
    print((b - a + 1) // x)


Fixed submission:
a, b, x = map(int, input().split())
print(b // x - (a - 1) // x)
Problem p03861 (Python)

Buggy submission (status: Time Limit Exceeded):
a, b, x = [int(n) for n in input().split()]

res = 0
for n in range(a, b + 1):
    if n % x == 0:
        res += 1
print(res)


Fixed submission:
a, b, x = [int(n) for n in input().split()]

qa = a // x
qb = b // x
ra = a % x
rb = b % x
res = qb - qa
if ra == 0:
    res += 1

print(res)
Problem p03861 (Python)

Buggy submission (status: Time Limit Exceeded):
a, b, x = tuple(int(x) for x in input().split())

y = -1
for i in range(a, b + 1):
    if i % x == 0:
        y = i
        break

if y == -1:
    ans = 0
else:
    ans = (b - y) // x + 1

print(ans)


Fixed submission:
a, b, x = tuple(int(x) for x in input().split())

if a == 0:
    y = 0
else:
    y = x * ((a - 1) // x + 1)


if y == -1:
    ans = 0
else:
    ans = (b - y) // x + 1

print(ans)
Problem p03861 (Python)

Buggy submission (status: Runtime Error):
print("A" + input()[8] + "C")


Fixed submission:
a, b, x = map(int, input().split())
print(b // x - (a - 1) // x)
Problem p03861 (C++)

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

using namespace std;

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


Fixed submission:
#include <iostream>

using namespace std;

int main() {
  long long a, b, x, ans = 0;
  cin >> a >> b >> x;
  ans = b / x - a / x;
  if (a % x == 0) {
    ans++;
  }
  cout << ans << endl;
  return 0;
}
Problem p03861 (Python)

Buggy submission (status: Time Limit Exceeded):
a, b, x = map(int, input().split())
while b % x:
    b -= 1
if a == 0:
    print(b // x + 1)
else:
    print((b // x) - ((a - 1) // x))


Fixed submission:
a, b, x = map(int, input().split())
if a == 0:
    print(b // x + 1)
else:
    print((b // x) - ((a - 1) // x))
Problem p03861 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

#define MP make_pair
#define F first
#define S second

int main() {
  ll a, b, x, ans;
  cin >> a >> b >> x;
  ans = b / x - a / x;
  if (a % b == 0)
    ans++;
  cout << ans << endl;
}

Fixed submission:
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

#define MP make_pair
#define F first
#define S second

int main() {
  ll a, b, x, ans;
  cin >> a >> b >> x;
  ans = b / x - a / x;
  if (a % x == 0)
    ans++;
  cout << ans << endl;
}
Problem p03861 (C++)

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

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

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

int main() {
  unsigned long long a, b, c, i = 0;
  cin >> a >> b >> c;
  i = (b / c) - (a / c);
  if (a % c == 0)
    i++;
  cout << i;
}
Problem p03861 (C++)

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

using namespace std;

int main() {
  long long a, b, x;
  scanf("%lld %lld %lld", &a, &b, &x);
  long long k = a / x;
  if (k * x < a)
    k = (k + 1) * x;
  else
    k = k * x;
  long long ans = 0;
  for (; k <= b; k += x) {
    ans++;
  }
  printf("%lld\n", ans);
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>

using namespace std;

int main() {
  long long a, b, x;
  scanf("%lld %lld %lld", &a, &b, &x);
  long long k = a / x;
  if (k * x < a)
    k = (k + 1) * x;
  else
    k = k * x;
  long long s = b / x;
  if ((s + 1) * x == a)
    s = (s + 1) * x;
  else
    s = s * x;
  printf("%lld\n", (s - k) / x + 1);
  return 0;
}
Problem p03861 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, x, count = 0;
  cin >> a >> b >> x;
  for (long long i = a; i <= b; i++) {
    if (i % x == 0)
      count++;
  }
  cout << count << endl;
  return 0;
}


Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, x, count = 0;
  cin >> a >> b >> x;
  count += b / x;
  if (a != 0)
    count -= (a - 1) / x;
  if (a != 0)
    cout << count << endl;
  else
    cout << count + 1 << endl;
  return 0;
}
Problem p03861 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <algorithm>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;

int inf = (1 << 30);
int mod = 1e9 + 7;
int64_t inf64 = (1LL << 60);

template <typename T> T gcd(T a, T b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}

template <typename T> T lcm(T a, T b) {
  T g = gcd(a, b);
  return a / g * b;
}

bool check(vector<int> a, int index, int key) {
  if (a[index] >= key)
    return true;
  else
    return false;
}

int lower_bound(vector<int> a, int key) {
  int left = -1, right = a.size();
  while (right - left > 1) {
    int mid = left + (left + right) / 2;
    if (check(a, mid, key))
      right = mid;
    else
      left = mid;
  }
  return right;
}

int main() {

  int64_t a, b, x;
  cin >> a >> b >> x;

  int64_t count = 0;
  for (int i = a; i <= b; i++) {
    if (i % x == 0)
      count++;
  }

  cout << count << endl;

  return 0;
}

Fixed submission:
#include <algorithm>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;

int inf = (1 << 30);
int mod = 1e9 + 7;
int64_t inf64 = (1LL << 60);

template <typename T> T gcd(T a, T b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}

template <typename T> T lcm(T a, T b) {
  T g = gcd(a, b);
  return a / g * b;
}

bool check(vector<int> a, int index, int key) {
  if (a[index] >= key)
    return true;
  else
    return false;
}

int lower_bound(vector<int> a, int key) {
  int left = -1, right = a.size();
  while (right - left > 1) {
    int mid = left + (left + right) / 2;
    if (check(a, mid, key))
      right = mid;
    else
      left = mid;
  }
  return right;
}

int main() {

  int64_t a, b, x;
  cin >> a >> b >> x;

  if (a == 0)
    cout << b / x + 1 << endl;
  else
    cout << b / x - (a - 1) / x << endl;

  return 0;
}
Problem p03861 (C++)

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

int main() {
  long a, b, x;
  cin >> a >> b >> x;
  long ans = 0;
  for (int i = a; i <= b; i++) {
    if (i % x == 0) {
      ans++;
    }
  }
  cout << ans;
}

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

int main() {
  long a, b, x;
  cin >> a >> b >> x;
  long A = (a % x == 0 ? a / x : a / x + 1);
  long B = b / x;
  cout << (B - A >= 0 ? (B - A) + 1 : 0);
}
Problem p03861 (C++)

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

using namespace std;

int main() {
  unsigned long long int A, B, X;
  cin >> A >> B;

  cout << (B / X) - ((A - 1) / X);
}

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

using namespace std;

int main() {
  unsigned long long int A, B, X;
  cin >> A >> B >> X;
  unsigned long long int ans;
  if (A != 0LL)
    ans = (B / X) - ((A - 1) / X);
  else
    ans = B / X + 1;
  cout << ans;
}
Problem p03861 (C++)

Buggy submission (status: Runtime Error):
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <utility>
#include <vector>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define MOD 1000000007
using namespace std;
int main() {
  ll a, b, x;
  cin >> a, b, x;
  cout << b / x - a / x + (a % x == 0) << endl;
}

Fixed submission:
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <utility>
#include <vector>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define MOD 1000000007
using namespace std;
int main() {
  ll a, b, x;
  cin >> a >> b >> x;
  cout << b / x - a / x + (a % x == 0) << endl;
}
Problem p03861 (C++)

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

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


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

int main() {
  ll a, b, x;
  cin >> a >> b >> x;
  ll ans = 0;
  if (a % x == 0)
    ans = b / x - a / x + 1;
  else
    ans = b / x - a / x;
  cout << ans << endl;
}
Problem p03861 (C++)

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

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

  int count = 0;

  for (long long i = a; i <= b; i++) {
    if (i % x == 0)
      count++;
  }

  cout << count << endl;

  return 0;
}

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

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

  cout << b / x - a / x + ((a % x == 0) ? 1 : 0) << endl;

  return 0;
}
Problem p03861 (C++)

Buggy submission (status: Time Limit Exceeded):
#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, x;
  long long ans = 0;
  cin >> a >> b >> x;
  for (long long i = a; i <= b; i++) {
    if (i % x == 0) {
      ans = 1 + (b - i) / x;
      break;
    }
  }

  cout << ans << endl;
}

Fixed submission:
#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, x;
  long long ans = 0;
  cin >> a >> b >> x;
  if (a == 0)
    ans = b / x + 1;
  else
    ans = b / x - (a - 1) / x;
  cout << ans << endl;
}
Problem p03861 (C++)

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

using ll = long long;

void solve() {
  ll a, b, x;
  cin >> a >> b >> x;
  ll cnt = 0;
  for (ll i = a; i <= b; i++) {
    if (i % x == 0) {
      cnt++;
    }
  }
  cout << cnt << endl;
}

signed main() {
  // while(1)
  solve();
}

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

using ll = long long;

void solve() {
  ll a, b, x;
  cin >> a >> b >> x;
  ll u, w;
  u = a / x * x;
  if (u < a)
    u += x;
  w = b / x * x;
  cout << (w - u) / x + 1 << endl;
}

signed main() {
  // while(1)
  solve();
}